From ba4429022b6c0e1f45aea48729e1a9e879115899 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Mon, 2 May 2016 14:57:43 -0700 Subject: [PATCH] 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 --- launch/launch-node.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/launch/launch-node.py b/launch/launch-node.py index 6db6db0f07..b8b270d5a7 100755 --- a/launch/launch-node.py +++ b/launch/launch-node.py @@ -172,7 +172,12 @@ def build_server(cloud, name, image, flavor, cloud.delete_keypair(key_name) 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, mount_path, fs_label) print('UUID=%s\nIPV4=%s\nIPV6=%s\n' % (