nova service-delete is handled by HostAPI.service_delete method.
Normally, it searches for relevant Service object in DB and calls
destroy() on it. However, in API cell it is over-ridden so that
service_delete message can be routed to appropriate cell. Once the
destination cell is reached, the message processor invokes
HostAPI.service_delete to perform the actual delete. This works in
case of child cells.
However in case of API cells, since HostAPI.service_delete has been
over-ridden, when the message processor invokes HostAPI.service_delete
to perform actual delete of the service, the API cell tries to again
route the message and fails in doing so with an AttributeError (as
the message is already at the destination cell and can not be further
routed).
This patch moves the object destroy() call to a separate function and
modifies the message processor to call the new function. The original
service_delete is modified to also call the new function.
Reviewed: https:/ /review. openstack. org/126851 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=b0feaba45ff 53d20a93bc4b299 36d13550d15bf6
Committed: https:/
Submitter: Jenkins
Branch: master
commit b0feaba45ff53d2 0a93bc4b29936d1 3550d15bf6
Author: Dheeraj Gupta <email address hidden>
Date: Wed Oct 8 09:24:18 2014 +0000
Make service-delete work in API cells
nova service-delete is handled by HostAPI. service_ delete method. service_ delete to perform the actual delete. This works in service_ delete has been service_ delete
Normally, it searches for relevant Service object in DB and calls
destroy() on it. However, in API cell it is over-ridden so that
service_delete message can be routed to appropriate cell. Once the
destination cell is reached, the message processor invokes
HostAPI.
case of child cells.
However in case of API cells, since HostAPI.
over-ridden, when the message processor invokes HostAPI.
to perform actual delete of the service, the API cell tries to again
route the message and fails in doing so with an AttributeError (as
the message is already at the destination cell and can not be further
routed).
This patch moves the object destroy() call to a separate function and
modifies the message processor to call the new function. The original
service_delete is modified to also call the new function.
Change-Id: I9148d8ceb5cdeb 858dc9741b24cf0 e03487c9a62
Closes-Bug: 1361186