Create new function: get_serialnumber. Tested with Simulator (v1) + Proliant v0.9.5 + Proliant v1.0

This commit is contained in:
vmisson 2015-09-24 16:00:50 +02:00 committed by Uggla
parent d3506f6a2e
commit c48f239792
2 changed files with 11 additions and 0 deletions

View File

@ -42,4 +42,6 @@ print ("Redfish API version : %s \n" % remote_mgmt.get_api_version())
print("Bios version : {}\n".format(remote_mgmt.Systems.systems_list[0].get_bios_version()))
print("Serial Number : {}\n".format(remote_mgmt.Systems.systems_list[0].get_serialnumber()))
remote_mgmt.logout()

View File

@ -186,6 +186,15 @@ class Systems(Base):
# Hopefully this kind of discrepencies will be fixed with Redfish 1.0 (August)
return self.data.BiosVersion
def get_serialnumber(self):
try:
# Returned by proliant
return self.data.SerialNumber
except:
# Returned by mockup.
# Hopefully this kind of discrepencies will be fixed with Redfish 1.0 (August)
return ""
class SystemsCollection(BaseCollection):
"""Class to manage redfish ManagersCollection data."""