summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-07-27 04:13:59 +0000
committerGerrit Code Review <review@openstack.org>2017-07-27 04:13:59 +0000
commit790303e7b38d275b003bd8b98d8665821183191a (patch)
tree9c7d97ed3869e16628c7e17dd63198370a067bcc
parentb4abd9cdef341a68102deee602dd6f6624227c2a (diff)
parent3e235b2b510199a58bc3e19290ad42fd0aa5e289 (diff)
downloadpython-cinderclient-790303e7b38d275b003bd8b98d8665821183191a.tar.gz
Merge "Make --profile load from environment variables"
-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 17f4aac..4194c6d 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.