Skip to content
This repository was archived by the owner on Aug 23, 2024. It is now read-only.

Commit 959ee9a

Browse files
authoredOct 3, 2019
Merge pull request #9 from billdodd/fix/log-exceptions
Print exceptions caught and fix call to RMCOBJ.logout()
2 parents 4d17d7d + 5f9a9e6 commit 959ee9a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎redfish-uri-validator.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import os
2020
import re
2121
import sys
22+
import traceback
2223
import yaml
2324

2425
from redfish.ris import RmcApp
@@ -46,6 +47,7 @@ def run_test( user, password, rhost, openapi ):
4647
openapi_data = yaml.load( openapi_file, Loader = yaml.FullLoader )
4748
except:
4849
print( "ERROR: Could not open {}".format( openapi ) )
50+
print( traceback.format_exc() )
4951
return None
5052

5153
# Creating RMC object
@@ -58,7 +60,7 @@ def run_test( user, password, rhost, openapi ):
5860

5961
# If current cache exist try to log it out
6062
if os.path.isdir( cachedir ):
61-
RMCOBJ.logout
63+
RMCOBJ.logout()
6264

6365
# Login into the server, create a session, and download all resources
6466
print( "Service URI: {}".format( rhost ) )
@@ -67,14 +69,15 @@ def run_test( user, password, rhost, openapi ):
6769
RMCOBJ.login( base_url = rhost, username = user, password = password )
6870
except:
6971
print( "ERROR: Could not log into {} with credentials '{}':'{}'".format( rhost, user, password ) )
72+
print( traceback.format_exc() )
7073
return None
7174

7275
# Get all resources
7376
RMCOBJ.select( [ '"*"' ] )
7477
response = RMCOBJ.get()
7578

7679
# Go through each response and check the @odata.type and @odata.id properties against the OpenAPI file
77-
print( "Generating results..." );
80+
print( "Generating results..." )
7881
results = {}
7982
results["URIs"] = {}
8083
results["Orphans"] = []

0 commit comments

Comments
 (0)