def upgrade_kernel_and_grub(do_reboot=False, log=True):
""" updates the kernel and the grub config """
print(env.host_string)
if log:
log_yellow('upgrading kernel')
with settings(hide('running', 'stdout')):
sudo('unset UCF_FORCE_CONFFOLD; '
'export UCF_FORCE_CONFFNEW=YES; '
'ucf --purge /boot/grub/menu.lst; '
'export DEBIAN_FRONTEND=noninteractive ; '
'apt-get update; '
'apt-get -o Dpkg::Options::="--force-confnew" --force-yes -fuy '
'dist-upgrade')
with settings(warn_only=True):
if do_reboot:
if log:
log_yellow('rebooting host')
reboot()
评论列表
文章目录