Ubuntu Pastebin

Paste from rharper at Tue, 28 Mar 2017 20:38:15 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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', {})
Download as text