Commit b5e82a96 authored by Jose A. Lopes's avatar Jose A. Lopes
Browse files

Fix 'tools/move-instance' for instances without OS scripts



Moving instances requires creating a new instance, but
'tools/move-instance' was passing an empty string for OS scripts when
the source instance did not have OS scripts defined.
Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
Reviewed-by: default avatarHrvoje Ribicic <riba@google.com>
parent 83fc0ab6
......@@ -628,6 +628,11 @@ class MoveDestExecutor(object):
for idx, (nic, override) in enumerate(zip(nics, override_nics)):
nics[idx] = objects.FillDict(nic, override)
if instance["os"]:
os_type = instance["os"]
else:
os_type = None
# TODO: Should this be the actual up/down status? (run_state)
start = (instance["config_state"] == "up")
......@@ -648,7 +653,7 @@ class MoveDestExecutor(object):
return cl.CreateInstance(constants.INSTANCE_REMOTE_IMPORT,
name, disk_template, disks, nics,
os=instance["os"],
os=os_type,
pnode=pnode,
snode=snode,
start=start,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment