diff options
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/stages.py | 26 | ||||
-rw-r--r-- | cloudinit/util.py | 5 |
2 files changed, 14 insertions, 17 deletions
diff --git a/cloudinit/stages.py b/cloudinit/stages.py index 86a13785..ca3f02fe 100644 --- a/cloudinit/stages.py +++ b/cloudinit/stages.py @@ -845,23 +845,15 @@ class Modules(object): def fetch_base_config(): - base_cfgs = [] - default_cfg = util.get_builtin_cfg() - - # Anything in your conf.d location?? - # or the 'default' cloud.cfg location??? - base_cfgs.append(util.read_conf_with_confd(CLOUD_CONFIG)) - - # Kernel/cmdline parameters override system config - kern_contents = util.read_cc_from_cmdline() - if kern_contents: - base_cfgs.append(util.load_yaml(kern_contents, default={})) - - # And finally the default gets to play - if default_cfg: - base_cfgs.append(default_cfg) - - return util.mergemanydict(base_cfgs) + return util.mergemanydict( + [ + # builtin config + util.get_builtin_cfg(), + # Anything in your conf.d or 'default' cloud.cfg location. + util.read_conf_with_confd(CLOUD_CONFIG), + # Kernel/cmdline parameters override system config + util.read_conf_from_cmdline(), + ], reverse=True) def _pkl_store(obj, fname): diff --git a/cloudinit/util.py b/cloudinit/util.py index cc084719..01c396b4 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -993,6 +993,11 @@ def read_conf_with_confd(cfgfile): return mergemanydict([confd_cfg, cfg]) +def read_conf_from_cmdline(cmdline=None): + # return a dictionary or config on the cmdline or None + return load_yaml(read_cc_from_cmdline(cmdline=cmdline)) + + def read_cc_from_cmdline(cmdline=None): # this should support reading cloud-config information from # the kernel command line. It is intended to support content of the |