From 585c14fdf05ad57f817e5262e54458fa8a8d44ac Mon Sep 17 00:00:00 2001 From: Tatsuya Hayashino Date: Mon, 15 Apr 2024 12:16:56 +0900 Subject: [PATCH] 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 --- cinderclient/shell.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cinderclient/shell.py b/cinderclient/shell.py index ad7876c6e..b8aa28c4f 100644 --- a/cinderclient/shell.py +++ b/cinderclient/shell.py @@ -331,10 +331,7 @@ class OpenStackCinderShell(object): parser.add_argument('--os_region_name', help=argparse.SUPPRESS) - parser.add_argument( - '--os-token', metavar='', - 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)