Fix security group race condition while listing and deleting rules
Previously, there was a race condition that could occur if one was listing
a security group which contained a rule which referenced another security
group as an additional api call is used to look up the security group's
name which is returned (rather than id) via the API. The problem occurs if
this security group is deleted in which case a 404 was raised.
This patch fixes this issue by catching the 404 and ignoring the rule as
its already deleted as there is a constraint enforced that you cannot
delete a security group if another security group has a rule that references
that security group.
Change-Id: I3855b8d3a1bd2f7c88901da071f9bd5581bd56e4
Closes-bug: 1262566
(cherry picked from commit eb84cfb4ef7376401f48488d4810714c2664e5fa)
Reviewed: https:/ /review. openstack. org/97845 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=867341ff27c f91503e6919a270 2298ce39f679ad
Committed: https:/
Submitter: Jenkins
Branch: stable/icehouse
commit 867341ff27cf915 03e6919a2702298 ce39f679ad
Author: Aaron Rosen <email address hidden>
Date: Thu May 8 11:25:02 2014 -0700
Fix security group race condition while listing and deleting rules
Previously, there was a race condition that could occur if one was listing
a security group which contained a rule which referenced another security
group as an additional api call is used to look up the security group's
name which is returned (rather than id) via the API. The problem occurs if
this security group is deleted in which case a 404 was raised.
This patch fixes this issue by catching the 404 and ignoring the rule as
its already deleted as there is a constraint enforced that you cannot
delete a security group if another security group has a rule that references
that security group.
Change-Id: I3855b8d3a1bd2f 7c88901da071f9b d5581bd56e4 01f48488d481071 4c2664e5fa)
Closes-bug: 1262566
(cherry picked from commit eb84cfb4ef73764