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
This commit is contained in:
Tatsuya Hayashino 2024-04-15 12:16:56 +09:00
parent 4e71afe6ab
commit 585c14fdf0

View File

@ -331,10 +331,7 @@ class OpenStackCinderShell(object):
parser.add_argument('--os_region_name',
help=argparse.SUPPRESS)
parser.add_argument(
'--os-token', metavar='<token>',
default=utils.env('OS_TOKEN'),
help=_('Defaults to env[OS_TOKEN].'))
parser.set_defaults(os_token=utils.env('OS_TOKEN'))
parser.add_argument(
'--os_token',
help=argparse.SUPPRESS)