From 2e51f7b4b6b194eadbf27731b5d06ced732d3cb4 Mon Sep 17 00:00:00 2001 From: Bruno Cornec Date: Thu, 14 Mar 2019 00:54:54 +0100 Subject: [PATCH] Fix example for simulator to work with the HPE ilorestfulapiexplorer Change-Id: Ifc1a284e1a2f8fb727627edb1b026dfdfaeebf0c --- examples/simple-simulator.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/simple-simulator.py b/examples/simple-simulator.py index 3fd9e3a..f312fde 100644 --- a/examples/simple-simulator.py +++ b/examples/simple-simulator.py @@ -1,6 +1,10 @@ # coding=utf-8 -""" Simple example to use python-redfish with DMTF simulator """ +""" Simple example to use python-redfish with HPE simulator """ +# Works fine after the declaration of the default server with +# redfish-client config add default \ +# https://ilorestfulapiexplorer.ext.hpe.com/redfish/v1 + from __future__ import unicode_literals from __future__ import print_function from __future__ import division @@ -39,6 +43,7 @@ try: USER_NAME, PASSWORD, simulator=True, + verify_cert=False, enforceSSL=False) except redfish.exception.RedfishException as e: sys.stderr.write(e.message) @@ -52,5 +57,5 @@ print("System 1 :\n") print("Bios version : {}\n".format( remote_mgmt.Systems.systems_dict["1"].get_bios_version())) print("System 2 :\n") -print("Bios version : {}\n".format( - remote_mgmt.Systems.systems_dict["2"].get_parameter("SerialNumber"))) +print("Serial Number : {}\n".format( + remote_mgmt.Systems.systems_dict["1"].get_parameter("SerialNumber")))