summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.rst1
-rw-r--r--cinderclient/shell.py4
-rw-r--r--releasenotes/notes/profile-as-environment-variable-2a5c666ef759e486.yaml6
3 files changed, 10 insertions, 1 deletions
diff --git a/README.rst b/README.rst
index c9fe419..c79ef06 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 <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 d36294b..6d2a835 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 0000000..76fcd9d
--- /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.