help for - - all-tenants is incorrect

Bug #1962058 reported by Brian Rosmaita
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-cinderclient
Triaged
Low
Unassigned

Bug Description

Observed in Yoga development branch for the 'cinder backup-list' command, but it probably occurs in multiple places.

Compare these:

$ cinder help backup-list
usage: cinder backup-list [--all-tenants [<all_tenants>]] ...

Lists all backups.

Optional Arguments:
  --all-tenants [<all_tenants>]
                        Shows details for all tenants. Admin only.
[ ... etc ...]

$ cinder help list
usage: cinder list [--group_id <group_id>] [--all-tenants [<0|1>]] ...

Lists all volumes.

Optional Arguments:
  --all-tenants [<0|1>]
                        Shows details for all tenants. Admin only.
[ ... etc ...]

OK, so for backup-list the help shows that the argument to --all-tenants is a <all_tenants>, but what the heck is that? The type of the parameter is defined as an integer:

@utils.arg('--all-tenants',
           metavar='<all_tenants>',
           nargs='?',
           type=int,
           const=1,
           default=0,
           help='Shows details for all tenants. Admin only.')

The problem is the 'metavar' parameter. The definition should look something like this:

@utils.arg('--all-tenants',
           dest='all_tenants',
           metavar='<0|1>',,
           nargs='?',
           type=int,
           const=1,
           default=0,
           help='Shows details for all tenants. Admin only.')

(that is, it should be passing the name of the var to store the result in as 'dest' and it should include what we want displayed as the argument for the option as 'metavar').

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.