diff options
author | Scott Moser <smoser@ubuntu.com> | 2013-03-07 17:15:07 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2013-03-07 17:15:07 -0500 |
commit | 973747b00af47c94ba0a719452aa823fb688e5ab (patch) | |
tree | 647bbe6715ffd164726186a1fb4dfef7e6d483d9 /cloudinit/sources/DataSourceOVF.py | |
parent | 8013c284e82349246b2274f5475c138323fd7c55 (diff) | |
parent | 5da3984c2ca9e94b2483ab89ecdb5c93b5afb9f8 (diff) | |
download | vyos-cloud-init-973747b00af47c94ba0a719452aa823fb688e5ab.tar.gz vyos-cloud-init-973747b00af47c94ba0a719452aa823fb688e5ab.zip |
support different and user-suppliable merging algorithms for cloud-config
This adds a very useful mechanism for merging cloud-config, allowing
the user to append to lists (ie, just add more 'run_cmd') or other
things.
See doc/merging.txt for more information, it is intended to be backwards
compatible by default.
LP: #1023179
Diffstat (limited to 'cloudinit/sources/DataSourceOVF.py')
-rw-r--r-- | cloudinit/sources/DataSourceOVF.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cloudinit/sources/DataSourceOVF.py b/cloudinit/sources/DataSourceOVF.py index e90150c6..0530c4b7 100644 --- a/cloudinit/sources/DataSourceOVF.py +++ b/cloudinit/sources/DataSourceOVF.py @@ -43,7 +43,8 @@ class DataSourceOVF(sources.DataSource): self.supported_seed_starts = ("/", "file://") def __str__(self): - return "%s [seed=%s]" % (util.obj_name(self), self.seed) + root = sources.DataSource.__str__(self) + return "%s [seed=%s]" % (root, self.seed) def get_data(self): found = [] @@ -93,11 +94,11 @@ class DataSourceOVF(sources.DataSource): (md_seed, ud) = util.read_seeded(seedfrom, timeout=None) LOG.debug("Using seeded cache data from %s", seedfrom) - md = util.mergedict(md, md_seed) + md = util.mergemanydict([md, md_seed]) found.append(seedfrom) # Now that we have exhausted any other places merge in the defaults - md = util.mergedict(md, defaults) + md = util.mergemanydict([md, defaults]) self.seed = ",".join(found) self.metadata = md |