diff options
author | Scott Moser <smoser@ubuntu.com> | 2010-08-12 12:49:29 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2010-08-12 12:49:29 -0400 |
commit | f0ec102d6b9a21bf61d597ecb3ca739d8dbd86d6 (patch) | |
tree | ae28338434398f19c4f8713b2c66a5605c93cd27 /cloudinit | |
parent | 000580b60ba23519210768140a020b1e36518e14 (diff) | |
download | vyos-cloud-init-f0ec102d6b9a21bf61d597ecb3ca739d8dbd86d6.tar.gz vyos-cloud-init-f0ec102d6b9a21bf61d597ecb3ca739d8dbd86d6.zip |
DataSourceNoCloud: record where seeds were read from
This just records in 'self.seedfrom' each of the locations that
seed data was read from.
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/DataSourceNoCloud.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cloudinit/DataSourceNoCloud.py b/cloudinit/DataSourceNoCloud.py index 66be6126..175f39b4 100644 --- a/cloudinit/DataSourceNoCloud.py +++ b/cloudinit/DataSourceNoCloud.py @@ -48,14 +48,14 @@ class DataSourceNoCloud(DataSource.DataSource): "instance-id" : "nocloud" } - found = False + found = [ ] md = { } ud = "" try: # parse the kernel command line, getting data passed in if parse_cmdline_data(self.cmdline_id, md): - found = True + found.append("cmdline") except: util.logexc(cloudinit.log,util.WARN) return False @@ -65,12 +65,12 @@ class DataSourceNoCloud(DataSource.DataSource): if util.read_optional_seed(seedret,base=self.seeddir + "/"): md = util.mergedict(md,seedret['meta-data']) ud = seedret['user-data'] - found = True + found.append(self.seeddir) cloudinit.log.debug("using seeded cache data in %s" % self.seeddir) # there was no indication on kernel cmdline or data # in the seeddir suggesting this handler should be used. - if not found: + if len(found) == 0: return False # the special argument "seedfrom" indicates we should @@ -94,9 +94,10 @@ class DataSourceNoCloud(DataSource.DataSource): # values in the command line override those from the seed md = util.mergedict(md,md_seed) - self.seed = seedfrom + found.append(seedfrom) md = util.mergedict(md,defaults) + self.seed = ",".join(found) self.metadata = md; self.userdata_raw = ud return True |