python-glanceclient/glanceclient
Cyril Roelandt e2190c4feb do_image_import: fix argument retrieval
The argparse module automatically replaces '-' characters with '_'
characters when converting an option string to an attribute:

«For optional argument actions, the value of dest is normally inferred
from the option strings. ArgumentParser generates the value of dest by
taking the first long option string and stripping away the initial --
string. If no long option strings were supplied, dest will be derived
from the first short option string by stripping the initial - character.
Any internal - characters will be converted to _ characters to make sure
the string is a valid attribute name.»[1]

This means that the value of the "--remote-region" option of the
"image-import" command will be available as "args.remote_region";
"remote-region" would not be a valid attribute anyway.

We make sure to retrieve the proper value for the following
options: --remote-region, --remote-image-id and
--remote-service-interface.

[1] https://docs.python.org/3/library/argparse.html#dest

Change-Id: I1d8c69acd5d61fdc426469cd87d1ace81871e60f
Partial-Bug: #2012442
2023-04-18 03:21:03 +02:00
..
common Merge "Remove unicode-related Python2-only code" 2023-01-12 22:39:42 +00:00
tests do_image_import: fix argument retrieval 2023-04-18 03:21:03 +02:00
v1 Merge "Do not use the six library." 2020-07-17 19:32:29 +00:00
v2 do_image_import: fix argument retrieval 2023-04-18 03:21:03 +02:00
__init__.py Enable flake8 checks 2015-07-21 17:08:27 +03:00
_i18n.py Remove log translations 2017-03-21 07:19:21 +08:00
client.py Use import_versioned_module from oslo.utils 2016-12-06 09:35:55 +00:00
exc.py Do not use the six library. 2020-06-23 21:51:07 +02:00
shell.py glance help <subcommand>: Clearly specify which options are mandatory 2021-12-14 15:14:10 +00:00