From f5e205bbefd0beccba7dd8a2eb0dc016ebcbc167 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 16 Jun 2017 15:45:05 +0300 Subject: 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. --- vmdb/plugins/apt_plugin.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) -- cgit v1.2.1