supply Incorrect Argument is also passed

Bug #1424937 reported by Rakesh Mishra
6
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]

Anne Gentle (annegentle)
no longer affects: openstack-api-site
Revision history for this message
Kallebe Monteiro (kallebe-monteiro) wrote :

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.

Changed in python-cinderclient:
status: New → Invalid
status: Invalid → Opinion
status: Opinion → Incomplete
Revision history for this message
Sean McGinnis (sean-mcginnis) wrote : Bug Cleanup

Closing stale bug. This has be Incomplete status for over 90 days. If this is still an issue please reopen.

Changed in python-cinderclient:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.