From 5521e4c504c6a3a06f17a9e4f80444743aa293c7 Mon Sep 17 00:00:00 2001 From: Roxana Gherle Date: Fri, 22 May 2015 16:22:35 -0700 Subject: Add --os-endpoint-type cli optional argument User should be able to specify the endpoint type through a CLI optional argument/ENV variable setting. We will name this new optional argument: --os-endpoint-type (Env: OS_ENDPOINT_TYPE) and based on the value given, the service API will use that specific endpoint type. Possible values: public, admin, internal. DocImpact Closes-Bug: #1454392 Change-Id: Ife3d4e46b44c0ddcd712b1130e27e362545a9a29 --- openstackclient/common/utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'openstackclient/common/utils.py') diff --git a/openstackclient/common/utils.py b/openstackclient/common/utils.py index aad0519c..caafa837 100644 --- a/openstackclient/common/utils.py +++ b/openstackclient/common/utils.py @@ -368,3 +368,11 @@ def read_blob_file_contents(blob_file): except IOError: msg = "Error occurred trying to read from file %s" raise exceptions.CommandError(msg % blob_file) + + +def build_kwargs_dict(arg_name, value): + """Return a dictionary containing `arg_name` if `value` is set.""" + kwargs = {} + if value: + kwargs[arg_name] = value + return kwargs -- cgit v1.2.1