diff options
author | Chad Smith <chad.smith@canonical.com> | 2017-09-13 22:26:03 -0600 |
---|---|---|
committer | Chad Smith <chad.smith@canonical.com> | 2017-09-13 22:26:03 -0600 |
commit | f761f2b5f58c8cf13cfee63619f32046216cf66a (patch) | |
tree | e534cc7bd15d3ecf0cd0b09e0e3c50042dea1bcc /cloudinit/config | |
parent | cf10a2ff2e2f666d9370f38297a5a105e809ea3c (diff) | |
download | vyos-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/config')
-rw-r--r-- | cloudinit/config/cc_runcmd.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cloudinit/config/cc_runcmd.py b/cloudinit/config/cc_runcmd.py index 7f995693..449872f0 100644 --- a/cloudinit/config/cc_runcmd.py +++ b/cloudinit/config/cc_runcmd.py @@ -10,6 +10,7 @@ from cloudinit.config.schema import ( get_schema_doc, validate_cloudconfig_schema) +from cloudinit.distros import ALL_DISTROS from cloudinit.settings import PER_INSTANCE from cloudinit import util @@ -23,7 +24,7 @@ from textwrap import dedent # configuration options before actually attempting to deploy with said # configuration. -distros = ['all'] +distros = [ALL_DISTROS] schema = { 'id': 'cc_runcmd', |