diff --git a/README.rst b/README.rst index c9fe419b0..c79ef066b 100644 --- a/README.rst +++ b/README.rst @@ -289,6 +289,7 @@ You'll find complete documentation on the shell by running match the one configured on the cinder api server. Without key the profiling will not be triggered even if osprofiler is enabled on server side. + Defaults to env[OS_PROFILE]. --os-auth-strategy Authentication strategy (Env: OS_AUTH_STRATEGY, default keystone). For now, any other value will diff --git a/cinderclient/shell.py b/cinderclient/shell.py index d36294b84..6d2a83565 100644 --- a/cinderclient/shell.py +++ b/cinderclient/shell.py @@ -240,13 +240,15 @@ class OpenStackCinderShell(object): if osprofiler_profiler: parser.add_argument('--profile', metavar='HMAC_KEY', + default=utils.env('OS_PROFILE'), help=_('HMAC key to use for encrypting ' 'context data for performance profiling ' 'of operation. This key needs to match the ' 'one configured on the cinder api server. ' 'Without key the profiling will not be ' 'triggered even if osprofiler is enabled ' - 'on server side.')) + 'on server side. Defaults to ' + 'env[OS_PROFILE].')) self._append_global_identity_args(parser) diff --git a/releasenotes/notes/profile-as-environment-variable-2a5c666ef759e486.yaml b/releasenotes/notes/profile-as-environment-variable-2a5c666ef759e486.yaml new file mode 100644 index 000000000..76fcd9d3f --- /dev/null +++ b/releasenotes/notes/profile-as-environment-variable-2a5c666ef759e486.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + ``--profile`` argument can be loaded from ``OS_PROFILE`` + environment variable to avoid repeating ``--profile`` + in openstack commands.