diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-06-16 15:45:05 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-06-16 15:45:05 +0300 |
commit | f5e205bbefd0beccba7dd8a2eb0dc016ebcbc167 (patch) | |
tree | adaaef41f0c324951327970f90eadb94d4ff7ceb | |
parent | b8e308e1042ed2edf094786a91b405b445ed3eff (diff) | |
download | vmdb2-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.py | 8 |
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) |