summaryrefslogtreecommitdiff
path: root/cloudinit/distros/__init__.py
diff options
context:
space:
mode:
authorNate House nathan.house@rackspace.com <>2014-01-27 12:22:21 -0600
committerNate House nathan.house@rackspace.com <>2014-01-27 12:22:21 -0600
commit309457a96a84132d2e570bf902c464b2a1aa9d0b (patch)
treea6962fcd17eccaae448b1bccb06cea3f7d6a7800 /cloudinit/distros/__init__.py
parent8f6c9ff5ed7e301db2efa9ffa9a4bf454eb819e9 (diff)
downloadvyos-cloud-init-309457a96a84132d2e570bf902c464b2a1aa9d0b.tar.gz
vyos-cloud-init-309457a96a84132d2e570bf902c464b2a1aa9d0b.zip
Adds distro module exclude support
Diffstat (limited to 'cloudinit/distros/__init__.py')
-rw-r--r--cloudinit/distros/__init__.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
index 9c9ac384..a6d1e6c6 100644
--- a/cloudinit/distros/__init__.py
+++ b/cloudinit/distros/__init__.py
@@ -54,12 +54,20 @@ class Distro(object):
hostname_conf_fn = "/etc/hostname"
tz_zone_dir = "/usr/share/zoneinfo"
init_cmd = ['service'] # systemctl, service etc
+ exclude_modules = []
def __init__(self, name, cfg, paths):
self._paths = paths
self._cfg = cfg
self.name = name
+ def is_excluded(self, name):
+ if name in self.excluded_modules:
+ distro = getattr(self, name, None) or getattr(self, 'osfamily')
+ LOG.debug(("Skipping module named %s, distro excluded"), name,
+ distro)
+ return True
+
@abc.abstractmethod
def install_packages(self, pkglist):
raise NotImplementedError()