diff --git a/osc_lib/shell.py b/osc_lib/shell.py index e204d63..3d6cc53 100644 --- a/osc_lib/shell.py +++ b/osc_lib/shell.py @@ -283,6 +283,7 @@ class OpenStackShell(app.App): '--os-profile', metavar='hmac-key', dest='profile', + default=utils.env('OS_PROFILE'), help=_('HMAC key for encrypting profiling context data'), ) # NOTE(dtroyer): This global option should have been named diff --git a/osc_lib/tests/test_shell.py b/osc_lib/tests/test_shell.py index dc215bf..13f1822 100644 --- a/osc_lib/tests/test_shell.py +++ b/osc_lib/tests/test_shell.py @@ -112,7 +112,7 @@ global_options = { '--os-default-domain': (DEFAULT_DOMAIN_NAME, True, True), '--os-cacert': ('/dev/null', True, True), '--timing': (True, True, False), - '--os-profile': ('SECRET_KEY', True, False), + '--os-profile': ('SECRET_KEY', True, True), '--os-interface': (DEFAULT_INTERFACE, True, True) } diff --git a/releasenotes/notes/os-profile-as-environment-variable-a5e232e9ca7c5171.yaml b/releasenotes/notes/os-profile-as-environment-variable-a5e232e9ca7c5171.yaml new file mode 100644 index 0000000..66fff35 --- /dev/null +++ b/releasenotes/notes/os-profile-as-environment-variable-a5e232e9ca7c5171.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + ``--os-profile`` argument can be loaded from ``OS_PROFILE`` + environment variables to avoid repeating ``--os-profile`` + in openstack commands. \ No newline at end of file