summaryrefslogtreecommitdiffstats
path: root/storperf/utilities/dictionary.py
diff options
context:
space:
mode:
Diffstat (limited to 'storperf/utilities/dictionary.py')
-rw-r--r--storperf/utilities/dictionary.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/storperf/utilities/dictionary.py b/storperf/utilities/dictionary.py
new file mode 100644
index 0000000..95f625c
--- /dev/null
+++ b/storperf/utilities/dictionary.py
@@ -0,0 +1,15 @@
+##############################################################################
+# Copyright (c) 2016 EMC and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+
+def get_key_from_dict(dictionary, key, default_value=None):
+ if key in dictionary:
+ return dictionary[key]
+ else:
+ return default_value