]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Fix EIP template.
authorAngus Salkeld <asalkeld@redhat.com>
Fri, 22 Jun 2012 02:01:55 +0000 (12:01 +1000)
committerAngus Salkeld <asalkeld@redhat.com>
Fri, 22 Jun 2012 02:01:55 +0000 (12:01 +1000)
Some of the implemented flags were wrong.
Allow the eip to be deleted when no eip was created.

Change-Id: Id1d3aaff9adf0988a5c58f8bf0f7b2fb9c7bde44
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
heat/engine/eip.py
heat/engine/instance.py
heat/engine/security_group.py

index cc9b32ff65a5110a2b779011141440d7a333c76a..5aa032fabac1fa01108c5d380f4c1a426d080c9c 100644 (file)
@@ -17,6 +17,7 @@ import logging
 
 from heat.common import exception
 from heat.engine.resources import Resource
+from novaclient.exceptions import NotFound
 
 logger = logging.getLogger('heat.engine.eip')
 
@@ -104,5 +105,9 @@ class ElasticIpAssociation(Resource):
 
     def handle_delete(self):
         """Remove a floating IP address from a server."""
-        server = self.nova().servers.get(self.properties['InstanceId'])
-        server.remove_floating_ip(self.properties['EIP'])
+        try:
+            server = self.nova().servers.get(self.properties['InstanceId'])
+            if server:
+                server.remove_floating_ip(self.properties['EIP'])
+        except NotFound as ex:
+            pass
index 57928c344c80119cbcfb4059b445985ae74b01ff..cae673b9927c52f4a2329f8ef5d4813086e88c84 100644 (file)
@@ -91,8 +91,7 @@ class Instance(Resource):
                                               'Implemented': False},
                          'RamDiskId': {'Type': 'String',
                                        'Implemented': False},
-                         'SecurityGroups': {'Type': 'List',
-                                              'Implemented': False},
+                         'SecurityGroups': {'Type': 'List'},
                          'SecurityGroupIds': {'Type': 'List',
                                               'Implemented': False},
                          'SourceDestCheck': {'Type': 'Boolean',
index 7e4214b4522d4fbd02ff4c5f693c75a3bf737a07..edc913ed3e6084026fb9fc238e777bff6ead0c0d 100644 (file)
@@ -27,9 +27,9 @@ class SecurityGroup(Resource):
                                               'Required': True},
                          'VpcId': {'Type': 'String',
                                    'Implemented': False},
-                         'SecurityGroupIngress': {'Type': 'List',
-                                                  'Implemented': False},
-                         'SecurityGroupEgress': {'Type': 'List'}}
+                         'SecurityGroupIngress': {'Type': 'List'},
+                         'SecurityGroupEgress': {'Type': 'List',
+                                                  'Implemented': False}}
 
     def __init__(self, name, json_snippet, stack):
         super(SecurityGroup, self).__init__(name, json_snippet, stack)