From: Sandon Van Ness Date: Fri, 5 Apr 2013 02:15:14 +0000 (-0700) Subject: Install.py: Prevent prompts from breaking apt X-Git-Tag: 1.1.0~2183 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=df3d70fd62b78f9a664735f8660f2a88f1764817;p=teuthology.git 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 --- diff --git a/teuthology/task/install.py b/teuthology/task/install.py index aa98fc2be7..027cf21686 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(),