add get_config_obj to a DataSource object.
This will allow for a DataSource to provide its own config that will then be utilized as part of CloudConfig. [to be used in OVF]
This commit is contained in:
parent
c408f4f980
commit
b72490a35d
@ -49,6 +49,13 @@ class CloudConfig():
|
|||||||
cloudinit.log.debug(traceback.format_exc() + "\n")
|
cloudinit.log.debug(traceback.format_exc() + "\n")
|
||||||
cfg = None
|
cfg = None
|
||||||
if cfg is None: cfg = { }
|
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))
|
return(util.mergedict(cfg,self.cloud.cfg))
|
||||||
|
|
||||||
def handle(self, name, args, freq=None):
|
def handle(self, name, args, freq=None):
|
||||||
|
@ -35,6 +35,13 @@ class DataSource:
|
|||||||
def get_userdata_raw(self):
|
def get_userdata_raw(self):
|
||||||
return(self.userdata_raw)
|
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):
|
def get_public_ssh_keys(self):
|
||||||
keys = []
|
keys = []
|
||||||
if not self.metadata.has_key('public-keys'): return([])
|
if not self.metadata.has_key('public-keys'): return([])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user