Workaround for oslo_serialization bug 1515231
We shall not use jsonutils.load. Instead, read the file and the use jsonutils.loads. Change-Id: I3df9f8ecf477fa52a77990abfe83dd43326b61b1
This commit is contained in:
parent
63b33c48e2
commit
e2832876e9
@ -251,7 +251,8 @@ def patch_routers_without_gateway(resource, event, trigger, **kwargs):
|
|||||||
# Open state file, if exists, read data
|
# Open state file, if exists, read data
|
||||||
try:
|
try:
|
||||||
with open(state_filename) as f:
|
with open(state_filename) as f:
|
||||||
state_data = jsonutils.load(f)
|
data = f.read()
|
||||||
|
state_data = jsonutils.loads(data)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
LOG.debug("State file not created yet")
|
LOG.debug("State file not created yet")
|
||||||
state_data = {}
|
state_data = {}
|
||||||
@ -323,7 +324,8 @@ def restore_routers_without_gateway(resource, event, trigger, **kwargs):
|
|||||||
# Fail if file does not exist
|
# Fail if file does not exist
|
||||||
try:
|
try:
|
||||||
with open(state_filename) as f:
|
with open(state_filename) as f:
|
||||||
state_data = jsonutils.load(f)
|
data = f.read()
|
||||||
|
state_data = jsonutils.loads(data)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
LOG.error("State file %s was not found. Aborting", state_filename)
|
LOG.error("State file %s was not found. Aborting", state_filename)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user