2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-12 00:00:12 +00:00

Fix reventlog for python2

python2 does not have encoding and errors in open()
This commit is contained in:
Obihörnchen
2019-04-18 15:22:06 +02:00
committed by GitHub
parent 3967969226
commit c7157ef2d1

View File

@ -661,7 +661,7 @@ class OpenBMCRest(object):
# Check if policy table file is there
ras_event_mapping = {}
if os.path.isfile(RAS_POLICY_TABLE):
with open(RAS_POLICY_TABLE, encoding="utf8", errors='ignore') as data_file:
with open(RAS_POLICY_TABLE) as data_file:
policy_hash = json.load(data_file)
if policy_hash:
ras_event_mapping = policy_hash['events']