Closed
Description
SUMMARY
Noticed by @ravi
on Slack.
When running st2 action-alias match 'pack install vsphere'
multiple action-aliases are matched, causing an error.
This is confusing in two ways:
- Running that action-alias should not be ambiguous
- The help message for
st2 action-alias match
says it returns a list of matching aliases, but instead it either returns one or it errors.
ISSUE TYPE
- Bug Report
STACKSTORM VERSION
$ st2 --version
st2 2.10.1, on Python 2.7.5
OS / ENVIRONMENT / INSTALL METHOD
# OS
$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.6 (Maipo)
# Install method
puppet-st2
STEPS TO REPRODUCE
$ st2 action-alias match 'pack install vsphere'
EXPECTED RESULTS
$ st2 action-alias match 'pack install vsphere'
+--------------+-----------------------------------+
| name | description |
+--------------+-----------------------------------+
| pack_install | Install/upgrade StackStorm packs. |
+--------------+-----------------------------------+
ACTUAL RESULTS
$ st2 action-alias match 'pack install vsphere'
ERROR: 400 Client Error: Bad Request
MESSAGE: Command 'pack install vsphere' matched more than 1 pattern for url: http://127.0.0.1:9101/v1/actionalias/match
This is also confusing because st2 action-alias match --help
says it should return a list of matching aliases, when instead it either returns a single alias or it errors out if multiple are found.
$ st2 action-alias match --help
usage: st2 action-alias match [-h] [-t TOKEN] [--api-key API_KEY] [-j] [-y]
[-a ATTR [ATTR ...]] [-w WIDTH [WIDTH ...]]
command
Get the list of action aliases that match the command text.
INVESTIGATION
It appears that the action-alias packs.pack_install
has redundant patterns defined: https://github.com/StackStorm/st2/blob/master/contrib/packs/aliases/pack_install.yaml#L7-L12
I think the simplest fix is to remove the redundant pattern and change the display text for the one that is left behind.
Metadata
Metadata
Assignees
Labels
No labels