Make --profile load from environment variables

--profile argument can be loaded from OS_PROFILE environment variables
to avoid repeating --profile in client commands.

Co-Authored-By: Hieu LE <hieulq@vn.fujitsu.com>
Change-Id: Ia9b469024395327ec0ee082ddaea3234fc3ca5a6
This commit is contained in:
Tovin Seven 2017-06-19 10:09:48 +07:00
parent 2d5e3a7aaf
commit 3e235b2b51
3 changed files with 10 additions and 1 deletions

View File

@ -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

View File

@ -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)

View File

@ -0,0 +1,6 @@
---
features:
- |
``--profile`` argument can be loaded from ``OS_PROFILE``
environment variable to avoid repeating ``--profile``
in openstack commands.