diff options
-rw-r--r-- | cloudinit/CloudConfig/__init__.py | 7 | ||||
-rw-r--r-- | cloudinit/DataSource.py | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/cloudinit/CloudConfig/__init__.py b/cloudinit/CloudConfig/__init__.py index 22ad63a6..fe2dddcf 100644 --- a/cloudinit/CloudConfig/__init__.py +++ b/cloudinit/CloudConfig/__init__.py @@ -49,6 +49,13 @@ class CloudConfig(): cloudinit.log.debug(traceback.format_exc() + "\n") cfg = None if cfg is None: cfg = { } + + try: + ds_cfg = self.cloud.datasource.get_config_obj() + except: + ds_cfg = { } + + cfg = util.mergedict(cfg, ds_cfg) return(util.mergedict(cfg,self.cloud.cfg)) def handle(self, name, args, freq=None): diff --git a/cloudinit/DataSource.py b/cloudinit/DataSource.py index d1458ffd..316eb5ae 100644 --- a/cloudinit/DataSource.py +++ b/cloudinit/DataSource.py @@ -35,6 +35,13 @@ class DataSource: def get_userdata_raw(self): return(self.userdata_raw) + + # the data sources' config_obj is a cloud-config formated + # object that came to it from ways other than cloud-config + # because cloud-config content would be handled elsewhere + def get_config_obj(self): + return({ }) + def get_public_ssh_keys(self): keys = [] if not self.metadata.has_key('public-keys'): return([]) |