node last reboot time

Returns This property provides the last time System Inventory
collection On Reboot(CSIOR) was performed. The value is represented
as yyyymmddHHMMSS

retriewing this value to get the updated factory reset
value from ironic wsman bios interface

Change-Id: I73ff5eb517528afe56b5cf45a74fa5d5519db186
story:2008058
task:40739
This commit is contained in:
Yogesh Ramachandra 2020-08-27 10:04:34 -05:00
parent 3e52db0511
commit a4684d1df4
2 changed files with 32 additions and 1 deletions

View File

@ -94,6 +94,18 @@ class DRACClient(object):
"""
return self._power_mgmt.get_power_state()
def get_last_system_inventory_time(self):
"""Returns This property provides the last time System Inventory
Collection On Reboot(CSIOR) was performed. The value is represented
as yyyymmddHHMMSS.
:returns: value is represented as yyyymmddHHMMSS
:raises: WSManRequestFailure on request failures
:raises: WSManInvalidResponse when receiving invalid response
:raises: DRACOperationFailed on error reported back by the DRAC
interface
"""
return self._system_cfg.last_system_inventory_time()
def set_power_state(self, target_state):
"""Turns the server power on/off or do a reboot
@ -890,7 +902,8 @@ class DRACClient(object):
return self._raid_mgmt.delete_virtual_disk(virtual_disk)
def reset_raid_config(self, raid_controller):
"""Delete all the virtual disks and unassign all hot spare physical disks
"""Delete all the virtual disks and unassign all hot spare physical
disks
The job to reset the RAID controller config will be in pending state.
For the changes to be applied, a config job must be created.

View File

@ -58,6 +58,24 @@ class SystemConfiguration(object):
result[attribute.instance_id] = attribute
return result
def last_system_inventory_time(self):
""""This property provides the last time SystemInventory Collection
On Reboot(CSIOR)was performed. The value is rep/resented as
yyyymmddHHMMSS.
:returns: the time when the machine is last rebooted
:raises: WSManRequestFailure on request failures
:raises: WSManInvalidResponse when receiving invalid response
:raises: DRACOperationFailed on error reported back by the DRAC
interface
"""
filter_query = ('select LastSystemInventoryTime from DCIM_SystemView')
doc = self.client.enumerate(uris.DCIM_SystemView,
filter_query=filter_query)
inventorytime = utils.find_xml(doc, 'LastSystemInventoryTime',
uris.DCIM_SystemView)
return inventorytime.text
class SystemAttribute(object):
"""Generic System attribute class"""