Fix EIP template.

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>
changes/17/217/1
Angus Salkeld 10 years ago
parent e30ee55ff9
commit 2eadedf5fd
  1. 9
      heat/engine/eip.py
  2. 3
      heat/engine/instance.py
  3. 6
      heat/engine/security_group.py

@ -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

@ -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',

@ -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)

Loading…
Cancel
Save