diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-16 12:33:31 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-16 12:33:31 -0700 |
commit | 1a803c9f1f55095e1cf69bd4ca12bda0299b64b4 (patch) | |
tree | 83fcc4b9b8a4b14135a33793753c8fff82d910c9 /cloudinit/stages.py | |
parent | 75b46cc80c6a9ab65c3c7f430ffaa4157d0db369 (diff) | |
download | vyos-cloud-init-1a803c9f1f55095e1cf69bd4ca12bda0299b64b4.tar.gz vyos-cloud-init-1a803c9f1f55095e1cf69bd4ca12bda0299b64b4.zip |
Have the top level distro class take paths instead of a runner.
This allows the following:
1. Let the ubuntu subclass construct its own runner with those paths (since not every subclass may want it)
Adjust the base class + subclass to reflect this, adjust stages as well to reflect the constructor changes.
Diffstat (limited to 'cloudinit/stages.py')
-rw-r--r-- | cloudinit/stages.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/cloudinit/stages.py b/cloudinit/stages.py index 9d8ff2bb..8fa9d6d3 100644 --- a/cloudinit/stages.py +++ b/cloudinit/stages.py @@ -77,13 +77,11 @@ class Init(object): def distro(self): if not self._distro: # Try to find the right class to use - d_cfg = self._extract_cfg('system') - distro_name = d_cfg.pop('distro', 'ubuntu') - distro_cls = distros.fetch(distro_name) - LOG.debug("Using distro class %s", distro_cls) - distro = distro_cls(distro_name, d_cfg, - helpers.Runners(self.paths)) - self._distro = distro + scfg = self._extract_cfg('system') + name = scfg.pop('distro', 'ubuntu') + cls = distros.fetch(name) + LOG.debug("Using distro class %s", cls) + self._distro = cls(name, scfg, self.paths) return self._distro @property |