summaryrefslogtreecommitdiff
path: root/cloudinit/CloudConfig/cc_apt_update_upgrade.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/CloudConfig/cc_apt_update_upgrade.py')
-rw-r--r--cloudinit/CloudConfig/cc_apt_update_upgrade.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/cloudinit/CloudConfig/cc_apt_update_upgrade.py b/cloudinit/CloudConfig/cc_apt_update_upgrade.py
index ab2ece93..6d522705 100644
--- a/cloudinit/CloudConfig/cc_apt_update_upgrade.py
+++ b/cloudinit/CloudConfig/cc_apt_update_upgrade.py
@@ -1,5 +1,6 @@
import cloudinit.util as util
import subprocess
+import traceback
import os
def handle(name,cfg,cloud,log,args):
@@ -23,6 +24,15 @@ def handle(name,cfg,cloud,log,args):
for e in errors:
log.warn("Source Error: %s\n" % ':'.join(e))
+ dconf_sel = util.get_cfg_option_str(cfg, 'debconf_selections', False)
+ if dconf_sel:
+ log.debug("setting debconf selections per cloud config")
+ try:
+ util.subp(('debconf-set-selections', '-'), dconf_sel)
+ except:
+ log.error("Failed to run debconf-set-selections")
+ log.debug(traceback.format_exc())
+
pkglist = []
if 'packages' in cfg:
if isinstance(cfg['packages'],list):