summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cloudinit/util.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py
index 0cee8e17..7f5c1db4 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -53,6 +53,11 @@ def get_cfg_option_str(yobj, key, default=None):
if not yobj.has_key(key): return default
return yobj[key]
+def get_cfg_option_list_or_str(yobj, key, default=None):
+ if not yobj.has_key(key): return default
+ if isinstance(yobj[key],list): return yobj[key]
+ return([yobj[key]])
+
# merge values from src into cand.
# if src has a key, cand will not override
def mergedict(src,cand):