From 82af6b8513a97a22d02726a99558a5e5150f1dad Mon Sep 17 00:00:00 2001 From: Xiao Li Di Date: Fri, 3 Mar 2017 18:46:23 +0800 Subject: [PATCH] Fix neutron loadbalancer update/delete bug This commit aimed to fix the delete loadbalancer funtion. With this commit it can fix the following two bugs: 1. when update loadbalancer, met the error: self.no_billing_resource_method[method_name](env, start_response, ERROR oslo_middleware.catch_errors KeyError: 'put_lbaas/loadbalancers' 2. when delete the loadbalancer, met the error: show failed (client error): loadbalancer None could not be found --- gringotts/middleware/neutron.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gringotts/middleware/neutron.py b/gringotts/middleware/neutron.py index cdaf948..07c1dd7 100644 --- a/gringotts/middleware/neutron.py +++ b/gringotts/middleware/neutron.py @@ -78,6 +78,7 @@ def __init__(self, app, conf): self.resource_regex, self.change_fip_ratelimit_regex, self.update_listener_regex, + self.delete_loadbalancer_regex, ] self.no_billing_resource_regexs = [ self.delete_loadbalancer_regex, @@ -151,7 +152,7 @@ def start_listener_action(self, method, path_info, body): return False def delete_loadbalancer_action(self, method, path_info, body): - if method == 'PUT' \ + if method == 'DELETE' \ and self.delete_loadbalancer_regex.search(path_info): return True return False