Fix a bug in _create_nodes
The index value in node name is incorrect. This patch fixes this issue. Change-Id: I452656bbd30f37bc80acaac39a495d2a3bee311f
This commit is contained in:
parent
7bcd2727eb
commit
603036b5a6
@ -99,7 +99,7 @@ class ClusterAction(base.Action):
|
||||
'index': index + m,
|
||||
'metadata': {}
|
||||
}
|
||||
name = 'node-%s-%003d' % (cluster.id[:8], index)
|
||||
name = 'node-%s-%003d' % (cluster.id[:8], index + m)
|
||||
node = node_mod.Node(name, cluster.profile_id, cluster.id,
|
||||
context=self.context, **kwargs)
|
||||
|
||||
|
@ -238,6 +238,14 @@ class ClusterActionTest(base.SenlinTestCase):
|
||||
self.assertEqual([node1.id, node2.id], action.data['nodes'])
|
||||
self.assertEqual({'region': 'regionOne'}, node1.data['placement'])
|
||||
self.assertEqual({'region': 'regionTwo'}, node2.data['placement'])
|
||||
mock_node_calls = []
|
||||
for i in [1, 2]:
|
||||
mock_node_calls.append(mock.call('node-01234567-00%s' % i,
|
||||
mock.ANY, '01234567-123434',
|
||||
user=mock.ANY, project=mock.ANY,
|
||||
domain=mock.ANY, index=i,
|
||||
context=mock.ANY, metadata={}))
|
||||
mock_node.assert_has_calls(mock_node_calls)
|
||||
|
||||
@mock.patch.object(db_api, 'cluster_get')
|
||||
@mock.patch.object(node_mod, 'Node')
|
||||
|
Loading…
Reference in New Issue
Block a user