summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2017-04-10 10:59:55 -0600
committerspisarski <s.pisarski@cablelabs.com>2017-04-10 11:48:24 -0600
commite64bf898644b45f28f9df31dd054b8864e4828b8 (patch)
tree7a819ee0d5d9b84d35e84206f714345ac8265893
parent5326ef273bed28cd2e41f7d3ae6a19130b72389a (diff)
Problem found while working on FUNCTEST-577 where instances with
security groups need to be active before application. JIRA: FUNCTEST-577 Change-Id: I0d31b6afe4a378b3be85b335ba5f1568a0b26708 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
-rw-r--r--snaps/openstack/create_instance.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/snaps/openstack/create_instance.py b/snaps/openstack/create_instance.py
index 620483b..793f4c7 100644
--- a/snaps/openstack/create_instance.py
+++ b/snaps/openstack/create_instance.py
@@ -146,7 +146,11 @@ class OpenStackVmInstance:
# TODO - the call above should add security groups. The return object shows they exist but the association
# had never been made by OpenStack. This call is here to ensure they have been added
for sec_grp_name in self.instance_settings.security_group_names:
- nova_utils.add_security_group(self.__nova, self.__vm, sec_grp_name)
+ if self.vm_active(block=True):
+ nova_utils.add_security_group(self.__nova, self.__vm, sec_grp_name)
+ else:
+ raise Exception('Cannot applying security group with name ' + sec_grp_name +
+ ' to VM that did not activate with name - ' + self.instance_settings.name)
self.__apply_floating_ips()