Browse Source

Merge "Provide last system inventory time" into stable/train

stable/train 3.4.0
Zuul 4 months ago
committed by Gerrit Code Review
parent
commit
21ffd2b886
3 changed files with 8 additions and 3 deletions
  1. +5
    -2
      dracclient/resources/inventory.py
  2. +2
    -1
      dracclient/tests/test_inventory.py
  3. +1
    -0
      dracclient/tests/wsman_mocks/system_view-enum-ok.xml

+ 5
- 2
dracclient/resources/inventory.py View File

@ -64,7 +64,8 @@ Video = collections.namedtuple(
System = collections.namedtuple(
'System',
['id', 'lcc_version', 'model', 'service_tag', 'uuid'])
['id', 'lcc_version', 'model', 'service_tag', 'uuid',
'last_system_inventory_time'])
class InventoryManagement(object):
@ -252,7 +253,9 @@ class InventoryManagement(object):
service_tag=self._get_system_attr(drac_system, 'ServiceTag'),
model=self._get_system_attr(drac_system, 'Model'),
lcc_version=self._get_system_attr(drac_system,
'LifecycleControllerVersion'))
'LifecycleControllerVersion'),
last_system_inventory_time=self._get_system_attr(
drac_system, 'LastSystemInventoryTime').split('.')[0])
def _get_system_attr(self, drac_system, attr_name):
return utils.get_wsman_resource_attr(drac_system,


+ 2
- 1
dracclient/tests/test_inventory.py View File

@ -168,7 +168,8 @@ class ClientInventoryManagementTestCase(base.BaseTest):
uuid='ebd4edd3-dfd7-4c7d-a2c8-562b3c23b811',
service_tag='A1B2C3D',
model='PowerEdge R630',
lcc_version='2.1.0')
lcc_version='2.1.0',
last_system_inventory_time='20200902160859')
mock_requests.post(
'https://1.2.3.4:443/wsman',
text=test_utils.LifecycleControllerEnumerations[


+ 1
- 0
dracclient/tests/wsman_mocks/system_view-enum-ok.xml View File

@ -17,6 +17,7 @@
<n1:LifecycleControllerVersion>2.1.0</n1:LifecycleControllerVersion>
<n1:Model>PowerEdge R630</n1:Model>
<n1:ServiceTag>A1B2C3D</n1:ServiceTag>
<n1:LastSystemInventoryTime>20200902160859.000000+000</n1:LastSystemInventoryTime>
<n1:UUID>ebd4edd3-dfd7-4c7d-a2c8-562b3c23b811</n1:UUID>
</n1:DCIM_SystemView>
</wsman:Items>


Loading…
Cancel
Save