summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/create_instance.py
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2017-07-11 12:08:53 -0600
committerspisarski <s.pisarski@cablelabs.com>2017-07-11 12:54:46 -0600
commit589f587b9139b84437d1b7e8cb017018fc9a4e06 (patch)
tree3064f18ec710d09fa22daf133036d1607a979f7a /snaps/openstack/create_instance.py
parent5f3fe6856f07bd1289bac532264eccf6cba68d77 (diff)
Created domain classes for security groups.
Created SecurityGroup and SecurityGroupRule classes so the neutron_utils for security groups will be returning objects of these types instead of the OpenStack objects returned by the API calls. JIRA: SNAPS-116 Change-Id: I76ed1f85f7d54b984fc6f6ac28cee7680a1109e5 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/openstack/create_instance.py')
-rw-r--r--snaps/openstack/create_instance.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/snaps/openstack/create_instance.py b/snaps/openstack/create_instance.py
index c8e668f..99ab87c 100644
--- a/snaps/openstack/create_instance.py
+++ b/snaps/openstack/create_instance.py
@@ -660,7 +660,7 @@ class OpenStackVmInstance:
def add_security_group(self, security_group):
"""
Adds a security group to this VM. Call will block until VM is active.
- :param security_group: the OpenStack security group object
+ :param security_group: the SNAPS SecurityGroup domain object
:return True if successful else False
"""
self.vm_active(block=True)
@@ -671,8 +671,7 @@ class OpenStackVmInstance:
try:
nova_utils.add_security_group(self.__nova, self.get_vm_inst(),
- security_group['security_group'][
- 'name'])
+ security_group.name)
return True
except NotFound as e:
logger.warning('Security group not added - ' + str(e))