From feff4fb6924d97653f864912a179aaf8151a703f Mon Sep 17 00:00:00 2001 From: Uggla Date: Sat, 2 Jan 2016 14:15:21 +0100 Subject: [PATCH] Allow client to work with simulator - An empty login allow to connect to the DMTF refish mockup by setting simulator=True, verify_cert=False, enforceSSL=False. --- redfish-client/redfish-client.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/redfish-client/redfish-client.py b/redfish-client/redfish-client.py index 8197f36..908bb6c 100755 --- a/redfish-client/redfish-client.py +++ b/redfish-client/redfish-client.py @@ -253,10 +253,18 @@ if __name__ == '__main__': def get_manager_info(manager_name, check_SSL): connection_parameters = conf_file.get_manager_info(manager_name) + if not connection_parameters['login']: + simulator = True + enforceSSL = False + else: + simulator = False + enforceSSL = True remote_mgmt = redfish.connect(connection_parameters['url'], connection_parameters['login'], connection_parameters['password'], - verify_cert=check_SSL + verify_cert=check_SSL, + simulator=simulator, + enforceSSL=enforceSSL ) print ('Redfish API version : %s \n' % remote_mgmt.get_api_version()) @@ -320,8 +328,10 @@ if __name__ == '__main__': # If manager is not defined set it to 'default' if not arguments['']: manager_name = 'default' - # Check if the default section is available in our conf file - conf_file.check_manager(manager_name) + else: + manager_name = arguments[''] + # Check if the default section is available in our conf file + conf_file.check_manager(manager_name) if arguments['--insecure'] is True: get_manager_info(manager_name, False) else: