summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2013-05-07 21:38:06 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2013-05-07 21:38:06 -0700
commit229df67191e7dff058151f1e1f6e007667d55d9c (patch)
tree0958a460a7494b357b8f9cf41669a05a05290d78 /cloudinit
parent563af0754dc53fe4a95a4dee8ed18282f7a38104 (diff)
downloadvyos-cloud-init-229df67191e7dff058151f1e1f6e007667d55d9c.tar.gz
vyos-cloud-init-229df67191e7dff058151f1e1f6e007667d55d9c.zip
A few more test files.
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/mergers/m_list.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/cloudinit/mergers/m_list.py b/cloudinit/mergers/m_list.py
index 8a0b5827..1184ded7 100644
--- a/cloudinit/mergers/m_list.py
+++ b/cloudinit/mergers/m_list.py
@@ -19,6 +19,12 @@
DEF_MERGE_TYPE = 'replace'
MERGE_TYPES = ('append', 'prepend', DEF_MERGE_TYPE,)
+def _has_any(what, *keys):
+ for k in keys:
+ if k in what:
+ return True
+ return False
+
class Merger(object):
def __init__(self, merger, opts):
@@ -30,9 +36,9 @@ class Merger(object):
self._method = m
break
# Affect how recursive merging is done on other primitives
- self._recurse_str = 'recurse_str' in opts
- self._recurse_dict = 'recurse_dict' in opts
- self._recurse_array = 'recurse_array' in opts
+ self._recurse_str = _has_any(opts, 'recurse_str')
+ self._recurse_dict = _has_any(opts, 'recurse_dict')
+ self._recurse_array = _has_any(opts, 'recurse_array', 'recurse_list')
def __str__(self):
return ('ListMerger: (method=%s,recurse_str=%s,'