Typo in policy call
The callback notification to endpoint-policy upon deletion of a policy had a typo in it. This patch fixes this, and adds a test to ensure this notification is working as designed. The other three notifications already have tests, for some reason this one had been missed out. Closes-Bug: 1399857 Change-Id: I5060c30cd03b3154838db9e6f8fee94110751745
This commit is contained in:
@@ -46,7 +46,7 @@ class EndpointPolicyV3Controller(controller.V3Controller):
|
||||
payload['resource_info'])
|
||||
|
||||
def _on_policy_delete(self, service, resource_type, operation, payload):
|
||||
self.endpoint_policy_api.delete_association_by_polcy(
|
||||
self.endpoint_policy_api.delete_association_by_policy(
|
||||
payload['resource_info'])
|
||||
|
||||
@controller.protected()
|
||||
|
||||
@@ -178,6 +178,20 @@ class EndpointPolicyTestCase(TestExtensionCase):
|
||||
self.put(url, expected_status=204)
|
||||
self.get(url, expected_status=204)
|
||||
|
||||
self.delete('/policies/%(policy_id)s' % {
|
||||
'policy_id': self.policy['id']})
|
||||
|
||||
self.head(url, expected_status=404)
|
||||
|
||||
def test_service_association_cleanup_when_policy_deleted(self):
|
||||
url = ('/policies/%(policy_id)s/OS-ENDPOINT-POLICY'
|
||||
'/services/%(service_id)s') % {
|
||||
'policy_id': self.policy['id'],
|
||||
'service_id': self.service['id']}
|
||||
|
||||
self.put(url, expected_status=204)
|
||||
self.get(url, expected_status=204)
|
||||
|
||||
self.delete('/services/%(service_id)s' % {
|
||||
'service_id': self.service['id']})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user