summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-06-16 15:45:05 +0300
committerLars Wirzenius <liw@liw.fi>2017-06-16 15:45:05 +0300
commitf5e205bbefd0beccba7dd8a2eb0dc016ebcbc167 (patch)
treeadaaef41f0c324951327970f90eadb94d4ff7ceb
parentb8e308e1042ed2edf094786a91b405b445ed3eff (diff)
downloadvmdb2-f5e205bbefd0beccba7dd8a2eb0dc016ebcbc167.tar.gz
Fix: make apt installs be non-interactive
This means that if a package's maintainer scripts want to ask questions of the non-existent user, they won't and the install will continue instead.
-rw-r--r--vmdb/plugins/apt_plugin.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/vmdb/plugins/apt_plugin.py b/vmdb/plugins/apt_plugin.py
index d096084..d40f4cd 100644
--- a/vmdb/plugins/apt_plugin.py
+++ b/vmdb/plugins/apt_plugin.py
@@ -18,6 +18,7 @@
import logging
+import os
import sys
import cliapp
@@ -40,9 +41,14 @@ class AptStepRunner(vmdb.StepRunnerInterface):
package = step['apt']
fstag = step['fs-tag']
mount_point = state.mounts[fstag]
+
+ env = os.environ.copy()
+ env['DEBIAN_FRONTEND'] = 'noninteractive'
+
vmdb.progress(
'Install package {} to filesystem at {} ({})'.format(
package, mount_point, fstag))
vmdb.runcmd(
['chroot', mount_point,
- 'apt-get', '-y', '--no-show-progress', 'install', package])
+ 'apt-get', '-y', '--no-show-progress', 'install', package],
+ env=env)