Skip to content

Commit 585c14f

Browse files
Fix cinder command execution issue with a token
This commit fixes the issue where the following error occurs when executing cinder commands using a token: > ERROR: argument --os-token: conflicting option string: --os-token This issue arises because `os_token` is added to the parser in `keystoneauth1.loading.register_auth_argparse_arguments()`, and then `os_token` is set again by `parser.add_argument('--os-token')`. Closes-Bug: #2061349 Change-Id: I8d1ff0f202bec24ed2982108b6cbba1b7981b356
1 parent 4e71afe commit 585c14f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

cinderclient/shell.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,7 @@ def _append_global_identity_args(self, parser):
331331
parser.add_argument('--os_region_name',
332332
help=argparse.SUPPRESS)
333333

334-
parser.add_argument(
335-
'--os-token', metavar='<token>',
336-
default=utils.env('OS_TOKEN'),
337-
help=_('Defaults to env[OS_TOKEN].'))
334+
parser.set_defaults(os_token=utils.env('OS_TOKEN'))
338335
parser.add_argument(
339336
'--os_token',
340337
help=argparse.SUPPRESS)

0 commit comments

Comments
 (0)