From f0ec102d6b9a21bf61d597ecb3ca739d8dbd86d6 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 12 Aug 2010 12:49:29 -0400 Subject: DataSourceNoCloud: record where seeds were read from This just records in 'self.seedfrom' each of the locations that seed data was read from. --- cloudinit/DataSourceNoCloud.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'cloudinit') 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 -- cgit v1.2.3