diff --git a/examples/simple-proliant.py b/examples/simple-proliant.py index 9645b34..ca481c3 100644 --- a/examples/simple-proliant.py +++ b/examples/simple-proliant.py @@ -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() diff --git a/redfish/types.py b/redfish/types.py index d462731..80185dd 100644 --- a/redfish/types.py +++ b/redfish/types.py @@ -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."""