Properly handle volumes in launch node
We can only get the volume attach device if we are attaching a volume. Check if the volume is being attached and only determine the attachment location in that case to avoid errors. Story: 2000569 Change-Id: I4adc5e23abdfc0627a0850f845e2333d3bd25e63
This commit is contained in:
@@ -172,7 +172,12 @@ def build_server(cloud, name, image, flavor,
|
|||||||
cloud.delete_keypair(key_name)
|
cloud.delete_keypair(key_name)
|
||||||
|
|
||||||
server = cloud.get_openstack_vars(server)
|
server = cloud.get_openstack_vars(server)
|
||||||
volume_device = cloud.get_volume_attach_device(volume, server['id'])
|
if volume:
|
||||||
|
volume = cloud.get_volume(volume)
|
||||||
|
volume_device = cloud.get_volume_attach_device(volume,
|
||||||
|
server['id'])
|
||||||
|
else:
|
||||||
|
volume_device = None
|
||||||
bootstrap_server(server, key, name, volume_device, keep,
|
bootstrap_server(server, key, name, volume_device, keep,
|
||||||
mount_path, fs_label)
|
mount_path, fs_label)
|
||||||
print('UUID=%s\nIPV4=%s\nIPV6=%s\n' % (
|
print('UUID=%s\nIPV4=%s\nIPV6=%s\n' % (
|
||||||
|
|||||||
Reference in New Issue
Block a user