Skip to content

Commit

Permalink
Merge pull request #45 from tzumainn/more-node-info
Browse files Browse the repository at this point in the history
Add node state information
  • Loading branch information
tzumainn authored Aug 19, 2022
2 parents 82d8b04 + 1b71fbe commit 84871a5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
18 changes: 11 additions & 7 deletions esileapclient/tests/unit/osc/v1/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,18 @@ def test_node_list(self):
collist = [
"Name",
"Owner",
"Lessee",
"Provision State",
"Maintenance",
"Offer UUID",
"Lease UUID",
"Lessee"
]

self.assertEqual(collist, list(columns))

datalist = ((fakes.node_name,
fakes.node_owner,
'', '', ''
'', '', '', '', ''
),)
self.assertEqual(datalist, tuple(data))

Expand All @@ -65,21 +67,23 @@ def test_node_list_long(self):
self.client_mock.node.list.assert_called_with(filters)

long_collist = [
"Name",
"UUID",
"Name",
"Owner",
"Lessee",
"Provision State",
"Maintenance",
"Offer UUID",
"Lease UUID",
"Lessee",
"Future Offers",
"Future Leases"
]

self.assertEqual(long_collist, list(columns))

datalist = ((fakes.node_name,
fakes.node_uuid,
datalist = ((fakes.node_uuid,
fakes.node_name,
fakes.node_owner,
'', '', '', '', ''
'', '', '', '', '', '', ''
),)
self.assertEqual(datalist, tuple(data))
13 changes: 9 additions & 4 deletions esileapclient/v1/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,32 @@
class Node(base.Resource):

detailed_fields = {
'name': "Name",
'uuid': "UUID",
'name': "Name",
'owner': "Owner",
'lessee': "Lessee",
'provision_state': "Provision State",
'maintenance': "Maintenance",
'offer_uuid': "Offer UUID",
'lease_uuid': "Lease UUID",
'lessee': "Lessee",
'future_offers': "Future Offers",
'future_leases': "Future Leases"
}

fields = {
'name': "Name",
'owner': "Owner",
'lessee': "Lessee",
'provision_state': "Provision State",
'maintenance': "Maintenance",
'offer_uuid': "Offer UUID",
'lease_uuid': "Lease UUID",
'lessee': "Lessee"
}

_creation_attributes = ['name', 'uuid', 'owner', 'offer_uuid',
'lessee', 'lease_uuid', 'future_offers',
'future_leases']
'future_leases', 'provision_state',
'maintenace']

def __repr__(self):
return "<Node %s>" % self._info
Expand Down

0 comments on commit 84871a5

Please sign in to comment.