Always process node addresses
Never return a node without an address, otherwise the call to CLB will fail. Change-Id: I443b568f509246f8d38a8ddcf0ce4b1d1fd0c689
This commit is contained in:
parent
2fd7367475
commit
693e8605fb
@ -503,14 +503,11 @@ class CloudLoadBalancer(resource.Resource):
|
||||
return False
|
||||
|
||||
def _process_node(self, node):
|
||||
if not node.get(self.NODE_ADDRESSES):
|
||||
yield node
|
||||
else:
|
||||
for addr in node.get(self.NODE_ADDRESSES):
|
||||
norm_node = copy.deepcopy(node)
|
||||
norm_node['address'] = addr
|
||||
del norm_node[self.NODE_ADDRESSES]
|
||||
yield norm_node
|
||||
for addr in node.get(self.NODE_ADDRESSES, []):
|
||||
norm_node = copy.deepcopy(node)
|
||||
norm_node['address'] = addr
|
||||
del norm_node[self.NODE_ADDRESSES]
|
||||
yield norm_node
|
||||
|
||||
def _process_nodes(self, node_list):
|
||||
node_itr = six.moves.map(self._process_node, node_list)
|
||||
|
@ -424,7 +424,8 @@ class LoadBalancerTest(common.HeatTestCase):
|
||||
def test_process_node(self):
|
||||
nodes = [{'addresses': ['1234'], 'port': 80, 'enabled': True},
|
||||
{'addresses': ['4567', '8901', '8903'], 'port': 80,
|
||||
'enabled': True}]
|
||||
'enabled': True},
|
||||
{'addresses': [], 'port': 80, 'enabled': True}]
|
||||
rsrc, fake_lb = self._mock_loadbalancer(self.lb_template,
|
||||
self.lb_name,
|
||||
self.expected_body)
|
||||
|
Loading…
Reference in New Issue
Block a user