Merge "Use resource_id_set to clear resource ID's"

This commit is contained in:
Jenkins 2013-10-24 20:28:16 +00:00 committed by Gerrit Code Review
commit 8c7872e148
4 changed files with 6 additions and 6 deletions

View File

@ -484,7 +484,7 @@ class Instance(resource.Resource):
try: try:
server.get() server.get()
except clients.novaclient.exceptions.NotFound: except clients.novaclient.exceptions.NotFound:
self.resource_id = None self.resource_id_set(None)
break break
def _detach_volumes_task(self): def _detach_volumes_task(self):
@ -507,7 +507,7 @@ class Instance(resource.Resource):
try: try:
server = self.nova().servers.get(self.resource_id) server = self.nova().servers.get(self.resource_id)
except clients.novaclient.exceptions.NotFound: except clients.novaclient.exceptions.NotFound:
self.resource_id = None self.resource_id_set(None)
return return
server_delete_task = scheduler.TaskRunner(self._delete_server, server_delete_task = scheduler.TaskRunner(self._delete_server,

View File

@ -189,7 +189,7 @@ class SecurityGroup(resource.Resource):
pass pass
self.nova().security_groups.delete(self.resource_id) self.nova().security_groups.delete(self.resource_id)
self.resource_id = None self.resource_id_set(None)
def _handle_delete_neutron(self): def _handle_delete_neutron(self):
from neutronclient.common.exceptions import NeutronClientException from neutronclient.common.exceptions import NeutronClientException
@ -215,7 +215,7 @@ class SecurityGroup(resource.Resource):
except NeutronClientException as ex: except NeutronClientException as ex:
if ex.status_code != 404: if ex.status_code != 404:
raise raise
self.resource_id = None self.resource_id_set(None)
def FnGetRefId(self): def FnGetRefId(self):
if self.properties['VpcId']: if self.properties['VpcId']:

View File

@ -472,7 +472,7 @@ class Server(resource.Resource):
delete = scheduler.TaskRunner(nova_utils.delete_server, server) delete = scheduler.TaskRunner(nova_utils.delete_server, server)
delete(wait_time=0.2) delete(wait_time=0.2)
self.resource_id = None self.resource_id_set(None)
def handle_suspend(self): def handle_suspend(self):
''' '''

View File

@ -124,7 +124,7 @@ class Volume(resource.Resource):
yield yield
vol.get() vol.get()
except clients.cinderclient.exceptions.NotFound: except clients.cinderclient.exceptions.NotFound:
self.resource_id = None self.resource_id_set(None)
if volume_backups is not None: if volume_backups is not None:
def handle_snapshot_delete(self, state): def handle_snapshot_delete(self, state):