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/distros | |
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/distros')
-rw-r--r-- | cloudinit/distros/__init__.py | 4 | ||||
-rw-r--r-- | cloudinit/distros/ubuntu.py | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py index e85e702e..0ee7f06b 100644 --- a/cloudinit/distros/__init__.py +++ b/cloudinit/distros/__init__.py @@ -42,8 +42,8 @@ class Distro(object): __metaclass__ = abc.ABCMeta - def __init__(self, name, cfg, runner): - self._runner = runner + def __init__(self, name, cfg, paths): + self._paths = paths self._cfg = cfg self.name = name diff --git a/cloudinit/distros/ubuntu.py b/cloudinit/distros/ubuntu.py index ad12400a..9b743b55 100644 --- a/cloudinit/distros/ubuntu.py +++ b/cloudinit/distros/ubuntu.py @@ -23,6 +23,7 @@ import os from cloudinit import distros +from cloudinit import helpers from cloudinit import log as logging from cloudinit import util @@ -33,6 +34,13 @@ LOG = logging.getLogger(__name__) class Distro(distros.Distro): + def __init__(self, name, cfg, paths): + distros.Distro.__init__(self, name, cfg, paths) + # This will be used to restrict certain + # calls from repeatly happening (when they + # should only happen say once per instance...) + self._runner = helpers.Runners(paths) + def install_packages(self, pkglist): self._update_package_sources() self._apt_get('install', pkglist) |