version_fp.close()
return ret
-def install(ctx, config):
+def install_and_reboot(ctx, config):
for role, sha1 in config.iteritems():
log.info('Installing kernel version {sha1} on {role}...'.format(sha1=sha1,
role=role))
run.Raw('&&'),
'rm',
'/tmp/linux-image.deb',
- ],
- )
-
-def reboot(ctx, config):
- for role in config:
- log.info('Rebooting {role}...'.format(role=role))
- (role_remote,) = ctx.cluster.only(role).remotes.keys()
- role_remote.run(
- args=[
+ run.Raw('&&'),
'sudo',
'shutdown',
'-r',
need_install[role] = sha1
if len(need_install) > 0:
- install(ctx, need_install)
- reboot(ctx, need_install.keys())
+ install_and_reboot(ctx, need_install)
reconnect(ctx, timeout)
for client, sha1 in need_install.iteritems():