From 5995ae7e78dd19f4036f891db9db9fec97d6eab5 Mon Sep 17 00:00:00 2001 From: Sandon Van Ness Date: Thu, 4 Apr 2013 19:15:14 -0700 Subject: [PATCH] Install.py: Prevent prompts from breaking apt Change apt commands to prevent prompts from coming up (forcing non-interactive mode) so things like grub or other stuff doesn't break teuthology runs. Signed-off-by: Sandon Van Ness Reviewed-by: Josh Durgin --- teuthology/task/install.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/teuthology/task/install.py b/teuthology/task/install.py index aa98fc2be77d5..4255bb09ca928 100644 --- a/teuthology/task/install.py +++ b/teuthology/task/install.py @@ -130,7 +130,8 @@ def _update_deb_package_list_and_install(ctx, remote, debs, config): remote.run( args=[ 'sudo', 'apt-get', 'update', run.Raw('&&'), - 'sudo', 'apt-get', '-y', '--force-yes', + 'sudo', 'DEBIAN_FRONTEND=noninteractive', 'apt-get', '-y', '--force-yes', + '-o', run.Raw('Dpkg::Options::="--force-confdef"'), '-o', run.Raw('Dpkg::Options::="--force-confold"'), 'install', ] + ['%s=%s' % (d, version) for d in debs], stdout=StringIO(), @@ -212,7 +213,8 @@ def _remove_deb(remote, debs): ] + debs + [ run.Raw(';'), 'do', - 'sudo', 'apt-get', '-y', '--force-yes', 'purge', + 'sudo', 'DEBIAN_FRONTEND=noninteractive', 'apt-get', '-y', '--force-yes', + '-o', run.Raw('Dpkg::Options::="--force-confdef"'), '-o', run.Raw('Dpkg::Options::="--force-confold"'), 'purge', run.Raw('$d'), run.Raw('||'), 'true', @@ -235,7 +237,8 @@ def _remove_deb(remote, debs): # then let apt clean up remote.run( args=[ - 'sudo', 'apt-get', '-y', '--force-yes', + 'sudo', 'DEBIAN_FRONTEND=noninteractive', 'apt-get', '-y', '--force-yes', + '-o', run.Raw('Dpkg::Options::="--force-confdef"'), '-o', run.Raw('Dpkg::Options::="--force-confold"'), 'autoremove', ], stdout=StringIO(), @@ -468,7 +471,8 @@ def _upgrade_ceph_packages(ctx, remote, debs, ceph_branch): remote.run( args=[ 'sudo', 'apt-get', 'update', run.Raw('&&'), - 'sudo', 'apt-get', '-y', '--force-yes', + 'sudo', 'DEBIAN_FRONTEND=noninteractive', 'apt-get', '-y', '--force-yes', + '-o', run.Raw('Dpkg::Options::="--force-confdef"'), '-o', run.Raw('Dpkg::Options::="--force-confold"'), 'upgrade', ] + ['%s=%s' % (d, version) for d in debs], stdout=StringIO(), -- 2.39.5