From 67fe09104cb347c03ea608c72a1382e8ea252b1d Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 5 Apr 2012 00:08:42 -0400 Subject: move the reading of the cmdline cloud-config url to cloud-init.py The reason for moving this from cloudinit/__init__.py was that it was running too late there. The cloudinit.parsed_cfgs variable was already filled by cloud-init.py's reading of cloud config. I'm sure I had done this so that it would not have to re-parse configs. I think the right way to handle this is to move that logic back to cloudinit/__init__.py and add some function like 'reread_configs()' that would re-read all releavent cofnigs and re-setup logging. That seemed more error prone at the moment, with limited time. --- cloudinit/__init__.py | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'cloudinit') diff --git a/cloudinit/__init__.py b/cloudinit/__init__.py index 0b46dde9..85c6fd1b 100644 --- a/cloudinit/__init__.py +++ b/cloudinit/__init__.py @@ -140,24 +140,6 @@ class CloudInit: self.sysconfig = sysconfig - if DataSource.DEP_NETWORK in self.ds_deps: - target = "%s.d/%s" % (self.sysconfig, "91_kernel_cmdline_url.cfg") - if os.path.exists(target): - log.debug("cmdline: %s existed" % target) - else: - try: - (key, url, content) = get_cmdline_url() - if key and content: - util.write_file(target, content, mode=0600) - log.debug("cmdline: wrote %s from %s, %s" % - (target, key, url)) - elif key: - log.debug("cmdline: %s, %s had no cloud-config" % - (key, url)) - except Exception: - util.logexc(log) - log.warn("cmdline: exception occurred while reading") - self.cfg = self.read_cfg() def read_cfg(self): -- cgit v1.2.3