updatekeys_machines = list()
else:
machines_to_update.append(machine)
+ ops.update_nodes([machine], True)
teuthology.provision.create_if_vm(
ctx,
misc.canonicalize_hostname(machine),
)
with teuthology.parallel.parallel() as p:
+ ops.update_nodes(reimage_machines, True)
for machine in reimage_machines:
p.spawn(teuthology.provision.reimage, ctx, machine)
for machine in updatekeys_machines:
log = logging.getLogger(__name__)
-def update_nodes(nodes):
+def update_nodes(nodes, reset_os=False):
for node in nodes:
remote = teuthology.orchestra.remote.Remote(
canonicalize_hostname(node))
- inventory_info = remote.inventory_info
- teuthology.lock.ops.update_inventory(inventory_info)
+ if reset_os:
+ log.info("Updating [%s]: reset os type and version on server", node)
+ inventory_info = dict()
+ inventory_info['os_type'] = ''
+ inventory_info['os_version'] = ''
+ inventory_info['name'] = remote.hostname
+ else:
+ log.info("Updating [%s]: set os type and version on server", node)
+ inventory_info = remote.inventory_info
+ update_inventory(inventory_info)
def lock_many_openstack(ctx, num, machine_type, user=None, description=None,
machines=', '.join(machines.keys())))
if machine_type in vm_types:
ok_machs = {}
+ update_nodes(machines, True)
for machine in machines:
if teuthology.provision.create_if_vm(ctx, machine):
ok_machs[machine] = machines[machine]
)
with console_log.task(
ctx, console_log_conf):
+ update_nodes(reimaged, True)
with teuthology.parallel.parallel() as p:
for machine in machines:
p.spawn(teuthology.provision.reimage, ctx, machine)