supply Incorrect Argument is also passed
Bug #1424937 reported by
Rakesh Mishra
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-cinderclient |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Example:
cinder snapshot-list --all-tenants 1
cinder snapshot-list --all-tenant 1
cinder snapshot-list --all-ten 1
cinder snapshot-list --a 1
all commands are passed and given the same result
Expected result should be:
cinder snapshot-list --all-tenants 1 [should pass and return the result]
cinder snapshot-list --all-tenant 1 [should fail and return with error: unrecognized arguments: --all-tenant]
cinder snapshot-list --all-ten 1 [should fail and return with error: unrecognized arguments: --all-ten]
cinder snapshot-list --a1 [should fail and return with error: unrecognized arguments: --a]
no longer affects: | openstack-api-site |
To post a comment you must log in.
This is due to the behaviour of argparse python library used in every python-*client.
I did a test here and argparse is smart enough to figure out what argument you are using based on the prefix of the argument (similar to bash in that if you start typing and hit tab it will figure out which one you are trying to use).
You can test with other clients and see that the same thing happens.
For example:
If you have --verbose and --debug for command you can use
* command --v 1
* command --ver 1
and so on
However, I realized something with cinder list --all-tenants:
There is also a --all_tenants option that apparently does the same thing as --all-tenants. Maybe we could remove that.