From 1877a1e4e894dffc72c98107e6f8fb5521e52ca6 Mon Sep 17 00:00:00 2001 From: Tovin Seven Date: Mon, 19 Jun 2017 10:57:09 +0700 Subject: [PATCH] Make --os-profile load from environment variables + Make --os-profile argument can be loaded from OS_PROFILE environment variables to avoid repeating --os-profile in client commands. + Correct information in help of --os-profile argument Co-Authored-By: Hieu LE Change-Id: Ib1bbc3627bf976cc96ac623ee37b5d848e44f34f --- senlinclient/shell.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/senlinclient/shell.py b/senlinclient/shell.py index 0e9a067..057fb6c 100644 --- a/senlinclient/shell.py +++ b/senlinclient/shell.py @@ -101,12 +101,13 @@ class SenlinShell(object): def add_profiler_args(self, parser): if osprofiler_profiler: parser.add_argument( - '--os-profile', metavar='HMAC_KEY', + '--os-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 should ' - 'be the value of HMAC key configured in osprofiler ' - 'middleware in senlin, it is specified in the paste ' - 'deploy configuration (/etc/senlin/api-paste.ini). ' + 'be the value of HMAC key configured in ' + 'senlin configuration (/etc/senlin/senlin.conf). ' 'Without the key, profiling will not be triggered ' 'even if osprofiler is enabled on server side.'))