diff options
author | Vipin Balachandran <vbala@vmware.com> | 2016-10-10 15:06:11 +0530 |
---|---|---|
committer | Vipin Balachandran <vbala@vmware.com> | 2016-10-10 15:21:28 +0530 |
commit | ca4395caa8000339e31e55d5551c245cfea9f48c (patch) | |
tree | 47e1da469f029180c7075a4c4e4b7363e86bfd6a /osprofiler/cmd | |
parent | caff6c6fa20a2df24502aac800a983a5af586941 (diff) | |
download | osprofiler-ca4395caa8000339e31e55d5551c245cfea9f48c.tar.gz |
Use an env variable for connection string default
The user experience would be better if the connection string
can be set as an environment variable while running the trace
show command. This patch uses env[OSPROFILER_CONNECTION_STRING]
as the default connection string if set.
Change-Id: I816dceb05c4dad10897c965d7401a694d26a191a
Diffstat (limited to 'osprofiler/cmd')
-rw-r--r-- | osprofiler/cmd/commands.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/osprofiler/cmd/commands.py b/osprofiler/cmd/commands.py index 2b6258f..99be83e 100644 --- a/osprofiler/cmd/commands.py +++ b/osprofiler/cmd/commands.py @@ -30,8 +30,11 @@ class TraceCommands(BaseCommand): @cliutils.arg("trace", help="File with trace or trace id") @cliutils.arg("--connection-string", dest="conn_str", - default="ceilometer://", - help="storage driver's connection string") + default=(cliutils.env("OSPROFILER_CONNECTION_STRING") or + "ceilometer://"), + help="Storage driver's connection string. Defaults to " + "env[OSPROFILER_CONNECTION_STRING] if set, else " + "ceilometer://") @cliutils.arg("--json", dest="use_json", action="store_true", help="show trace in JSON") @cliutils.arg("--html", dest="use_html", action="store_true", |