summaryrefslogtreecommitdiff
path: root/openstackclient/common/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/common/utils.py')
-rw-r--r--openstackclient/common/utils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/openstackclient/common/utils.py b/openstackclient/common/utils.py
index c824678e..6cd35c05 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