diff options
| author | Stephen Finucane <sfinucan@redhat.com> | 2021-12-15 17:32:10 +0000 |
|---|---|---|
| committer | Stephen Finucane <sfinucan@redhat.com> | 2021-12-15 17:41:05 +0000 |
| commit | ba69870d86b5840dec06c6c30c8ddf50398bdb44 (patch) | |
| tree | 6e104bfc8515af8bd2cb5234c8c28ddb795b0168 /openstackclient/compute/v2 | |
| parent | c10a4cd96682d291dce571222de4fe5128f1c584 (diff) | |
| download | python-openstackclient-ba69870d86b5840dec06c6c30c8ddf50398bdb44.tar.gz | |
compute: Fix weird option definition for 'server ssh'
argparse allows you to specify multiple options for a given argument
when declaring the argument. For some reason, we weren't doing this for
the 'server ssh' command. There's no apparent reason for doing things
this way and it's been that way since the beginning (2013) so let's not
do that.
We also add unit tests since they were missing and should exist.
Change-Id: I67a9e6516d7057266210cd4083e9ddeb1cfaa5de
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'openstackclient/compute/v2')
| -rw-r--r-- | openstackclient/compute/v2/server.py | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py index a18ce810..5c603d04 100644 --- a/openstackclient/compute/v2/server.py +++ b/openstackclient/compute/v2/server.py @@ -4462,51 +4462,26 @@ class SshServer(command.Command): help=_('Server (name or ID)'), ) parser.add_argument( - '--login', + '--login', '-l', metavar='<login-name>', help=_('Login name (ssh -l option)'), ) parser.add_argument( - '-l', - dest='login', - metavar='<login-name>', - help=argparse.SUPPRESS, - ) - parser.add_argument( - '--port', + '--port', '-p', metavar='<port>', type=int, help=_('Destination port (ssh -p option)'), ) parser.add_argument( - '-p', - metavar='<port>', - dest='port', - type=int, - help=argparse.SUPPRESS, - ) - parser.add_argument( - '--identity', + '--identity', '-i', metavar='<keyfile>', help=_('Private key file (ssh -i option)'), ) parser.add_argument( - '-i', - metavar='<filename>', - dest='identity', - help=argparse.SUPPRESS, - ) - parser.add_argument( - '--option', + '--option', '-o', metavar='<config-options>', help=_('Options in ssh_config(5) format (ssh -o option)'), ) - parser.add_argument( - '-o', - metavar='<option>', - dest='option', - help=argparse.SUPPRESS, - ) ip_group = parser.add_mutually_exclusive_group() ip_group.add_argument( '-4', |
