Skip to content

Commit efb8d07

Browse files
author
yanyanhu
committed
Fix metadata property of Senlin node resource
This patch fixes metadata property of Senlin node resource. The corresponding field name in response body is 'metadata' rather than 'tags'. Change-Id: I123421d1b66b90ec6eed8fe987220b7e5b7b2618
1 parent f379573 commit efb8d07

File tree

2 files changed

+2
-25
lines changed

2 files changed

+2
-25
lines changed

openstack/cluster/v1/node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class Node(resource.Resource):
6868
#: A string describing why the node entered its current status.
6969
status_reason = resource.Body('status_reason')
7070
#: A map containing key-value pairs attached to the node.
71-
metadata = resource.Body('tags', type=dict)
71+
metadata = resource.Body('metadata', type=dict)
7272
#: A map containing some runtime data for this node.
7373
data = resource.Body('data', type=dict)
7474
#: A map containing the details of the physical object this node

openstack/tests/unit/cluster/v1/test_node.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
FAKE = {
2323
'id': FAKE_ID,
2424
'cluster_id': 'clusterA',
25-
'metadata': {},
25+
'metadata': {'key1': 'value1'},
2626
'name': FAKE_NAME,
2727
'profile_id': 'myserver',
2828
'index': 1,
@@ -33,28 +33,6 @@
3333
'init_at': '2015-10-10T12:46:36.000000',
3434
}
3535

36-
FAKE_CREATE_RESP = {
37-
'node': {
38-
'id': FAKE_ID,
39-
'name': FAKE_NAME,
40-
'cluster_id': '99001122-aabb-ccdd-ffff-efdcab124567',
41-
'action': '1122aabb-eeff-7755-2222-00991234dcba',
42-
'created_at': '2015-10-10T12:46:36.000000',
43-
'updated_at': '2016-10-10T12:46:36.000000',
44-
'data': {},
45-
'role': 'master',
46-
'index': 1,
47-
'init_at': '2015-10-10T12:46:36.000000',
48-
'metadata': {},
49-
'profile_id': '560a8f9d-7596-4a32-85e8-03645fa7be13',
50-
'profile_name': 'myserver',
51-
'project': '333acb15a43242f4a609a27cb097a8f2',
52-
'status': 'INIT',
53-
'status_reason': 'Initializing',
54-
'dependents': {},
55-
}
56-
}
57-
5836

5937
class TestNode(testtools.TestCase):
6038

@@ -73,7 +51,6 @@ def test_basic(self):
7351
def test_instantiate(self):
7452
sot = node.Node(**FAKE)
7553
self.assertEqual(FAKE['id'], sot.id)
76-
self.assertEqual(FAKE['name'], sot.name)
7754
self.assertEqual(FAKE['profile_id'], sot.profile_id)
7855
self.assertEqual(FAKE['cluster_id'], sot.cluster_id)
7956
self.assertEqual(FAKE['name'], sot.name)

0 commit comments

Comments
 (0)