summaryrefslogtreecommitdiff
path: root/cloudinit/distros/debian.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2013-03-19 08:22:30 -0400
committerScott Moser <smoser@ubuntu.com>2013-03-19 08:22:30 -0400
commita904de054f7818137c864e0f3ff728b3764cf457 (patch)
treee28f4807469f2c39554d4353bf11685c03a1b4aa /cloudinit/distros/debian.py
parent204e79b93c882e17df63b24f7f682c0dbefb482d (diff)
parentae0f94c8f39a234d73ab8e2caf24d73439c8b5ee (diff)
downloadvyos-cloud-init-a904de054f7818137c864e0f3ff728b3764cf457.tar.gz
vyos-cloud-init-a904de054f7818137c864e0f3ff728b3764cf457.zip
merge from trunk at revno 799
Diffstat (limited to 'cloudinit/distros/debian.py')
-rw-r--r--cloudinit/distros/debian.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/cloudinit/distros/debian.py b/cloudinit/distros/debian.py
index 1a8e927b..4b779d57 100644
--- a/cloudinit/distros/debian.py
+++ b/cloudinit/distros/debian.py
@@ -33,6 +33,10 @@ from cloudinit.settings import PER_INSTANCE
LOG = logging.getLogger(__name__)
+APT_GET_COMMAND = ('apt-get', '--option=Dpkg::Options::=--force-confold',
+ '--option=Dpkg::options::=--force-unsafe-io',
+ '--assume-yes', '--quiet')
+
class Distro(distros.Distro):
hostname_conf_fn = "/etc/hostname"
@@ -142,13 +146,15 @@ class Distro(distros.Distro):
# This ensures that the correct tz will be used for the system
util.copy(tz_file, self.tz_local_fn)
- def package_command(self, command, args=None, pkgs=[]):
+ def package_command(self, command, args=None, pkgs=None):
+ if pkgs is None:
+ pkgs = []
+
e = os.environ.copy()
# See: http://tiny.cc/kg91fw
# Or: http://tiny.cc/mh91fw
e['DEBIAN_FRONTEND'] = 'noninteractive'
- cmd = ['apt-get', '--option', 'Dpkg::Options::=--force-confold',
- '--assume-yes', '--quiet']
+ cmd = list(self.get_option("apt_get_command", APT_GET_COMMAND))
if args and isinstance(args, str):
cmd.append(args)