diff --git a/libra/worker/controller.py b/libra/worker/controller.py index 4bbc380c..4cd6fb3e 100644 --- a/libra/worker/controller.py +++ b/libra/worker/controller.py @@ -105,7 +105,7 @@ class LBaaSController(object): "Missing '%s' element" % self.LBLIST_FIELD ).to_json() - lb_list = self.msg['loadbalancers'] + lb_list = self.msg[self.LBLIST_FIELD] for current_lb in lb_list: if 'nodes' not in current_lb: diff --git a/tests/test_worker_controller.py b/tests/test_worker_controller.py index 7868ce5d..bf8d23a5 100644 --- a/tests/test_worker_controller.py +++ b/tests/test_worker_controller.py @@ -28,7 +28,7 @@ class TestWorkerController(unittest.TestCase): def testUpdate(self): msg = { c.ACTION_FIELD: 'UPDATE', - 'loadbalancers': [ + 'loadBalancers': [ { 'protocol': 'http', 'nodes': [ @@ -83,7 +83,7 @@ class TestWorkerController(unittest.TestCase): def testCreateMissingNodes(self): msg = { c.ACTION_FIELD: 'UPDATE', - 'loadbalancers': [ { 'protocol': 'http' } ] + 'loadBalancers': [ { 'protocol': 'http' } ] } controller = c(self.logger, self.driver, msg) response = controller.run() @@ -92,7 +92,7 @@ class TestWorkerController(unittest.TestCase): def testCreateMissingProto(self): msg = { c.ACTION_FIELD: 'UPDATE', - 'loadbalancers': [ + 'loadBalancers': [ { 'nodes': [ { @@ -110,7 +110,7 @@ class TestWorkerController(unittest.TestCase): def testBadAlgorithm(self): msg = { c.ACTION_FIELD: 'UPDATE', - 'loadbalancers': [ + 'loadBalancers': [ { 'protocol': 'http', 'algorithm': 'BOGUS',