summaryrefslogtreecommitdiff
path: root/cloudinit/distros/__init__.py
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2017-09-13 22:26:03 -0600
committerChad Smith <chad.smith@canonical.com>2017-09-13 22:26:03 -0600
commitf761f2b5f58c8cf13cfee63619f32046216cf66a (patch)
treee534cc7bd15d3ecf0cd0b09e0e3c50042dea1bcc /cloudinit/distros/__init__.py
parentcf10a2ff2e2f666d9370f38297a5a105e809ea3c (diff)
downloadvyos-cloud-init-f761f2b5f58c8cf13cfee63619f32046216cf66a.tar.gz
vyos-cloud-init-f761f2b5f58c8cf13cfee63619f32046216cf66a.zip
cloud-config modules: honor distros definitions in each module
Modules can optionally define a list of supported distros on which they can run by declaring a distros attribute in the cc_*py module. This branch fixes handling of cloudinit.stages.Modules.run_section. The behavior of run_section is now the following: - always run a module if the module doesn't declare a distros attribute - always run a module if the module declares distros = [ALL_DISTROS] - skip a module if the distribution on which we run isn't in module.distros - force a run of a skipped module if unverified_modules configuration contains the module name LP: #1715738 LP: #1715690
Diffstat (limited to 'cloudinit/distros/__init__.py')
-rwxr-xr-xcloudinit/distros/__init__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
index b714b9ab..d5becd12 100755
--- a/cloudinit/distros/__init__.py
+++ b/cloudinit/distros/__init__.py
@@ -30,6 +30,10 @@ from cloudinit import util
from cloudinit.distros.parsers import hosts
+# Used when a cloud-config module can be run on all cloud-init distibutions.
+# The value 'all' is surfaced in module documentation for distro support.
+ALL_DISTROS = 'all'
+
OSFAMILIES = {
'debian': ['debian', 'ubuntu'],
'redhat': ['centos', 'fedora', 'rhel'],