commit bcdff7dc77dd90371d3dd4371e31d675603454aa (HEAD -> rebased-netconfig-v2-passthrough)
Author: Ryan Harper <ryan.harper@canonical.com>
Date: Mon Mar 27 12:55:45 2017 -0500
Allow apt_configure to be disabled
diff --git a/cloudinit/config/cc_apt_configure.py b/cloudinit/config/cc_apt_configure.py
index 7f09c91..460b243 100644
--- a/cloudinit/config/cc_apt_configure.py
+++ b/cloudinit/config/cc_apt_configure.py
@@ -270,6 +270,12 @@ def handle(name, ocfg, cloud, log, _):
if log is not None:
global LOG
LOG = log
+
+ # check if disabled by config
+ if not util.get_cfg_option_bool(ocfg, 'apt_configure', True):
+ LOG.debug("Skipping module named %s, disabled by cfg", name)
+ return
+
# feed back converted config, but only work on the subset under 'apt'
ocfg = convert_to_v3_apt_format(ocfg)
cfg = ocfg.get('apt', {})