summaryrefslogtreecommitdiff
path: root/cloudinit/CloudConfig
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2011-03-08 10:52:11 -0500
committerScott Moser <smoser@ubuntu.com>2011-03-08 10:52:11 -0500
commita3d13c470357b4a87656ba2520d75bbcbc94a246 (patch)
tree8af130c0706408a8ede1970cdd0f2897a3a44bbb /cloudinit/CloudConfig
parent1e02db238117f1b7c0a30f6b6d0cad64c4dbe3a7 (diff)
downloadvyos-cloud-init-a3d13c470357b4a87656ba2520d75bbcbc94a246.tar.gz
vyos-cloud-init-a3d13c470357b4a87656ba2520d75bbcbc94a246.zip
fix issue where apt-update was not done unless explicitly set
Diffstat (limited to 'cloudinit/CloudConfig')
-rw-r--r--cloudinit/CloudConfig/cc_apt_update_upgrade.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/CloudConfig/cc_apt_update_upgrade.py b/cloudinit/CloudConfig/cc_apt_update_upgrade.py
index f361b8a4..495b8522 100644
--- a/cloudinit/CloudConfig/cc_apt_update_upgrade.py
+++ b/cloudinit/CloudConfig/cc_apt_update_upgrade.py
@@ -55,8 +55,10 @@ def handle(name,cfg,cloud,log,args):
log.error("Failed to run debconf-set-selections")
log.debug(traceback.format_exc())
+ pkglist = util.get_cfg_option_list_or_str(cfg,'packages',[])
+
errors = [ ]
- if update:
+ if update or len(pkglist) or upgrade:
try:
cc.update_package_sources()
except subprocess.CalledProcessError as e:
@@ -72,7 +74,6 @@ def handle(name,cfg,cloud,log,args):
log.debug(traceback.format_exc())
errors.append(e)
- pkglist = util.get_cfg_option_list_or_str(cfg,'packages',[])
if len(pkglist):
try:
cc.install_packages(pkglist)