diff --git a/vmware_nsx/shell/admin/plugins/nsxp/resources/migration.py b/vmware_nsx/shell/admin/plugins/nsxp/resources/migration.py index 934efaee27..0185b60fbc 100644 --- a/vmware_nsx/shell/admin/plugins/nsxp/resources/migration.py +++ b/vmware_nsx/shell/admin/plugins/nsxp/resources/migration.py @@ -251,7 +251,8 @@ def patch_routers_without_gateway(resource, event, trigger, **kwargs): # Open state file, if exists, read data try: with open(state_filename) as f: - state_data = jsonutils.load(f) + data = f.read() + state_data = jsonutils.loads(data) except FileNotFoundError: LOG.debug("State file not created yet") state_data = {} @@ -323,7 +324,8 @@ def restore_routers_without_gateway(resource, event, trigger, **kwargs): # Fail if file does not exist try: with open(state_filename) as f: - state_data = jsonutils.load(f) + data = f.read() + state_data = jsonutils.loads(data) except FileNotFoundError: LOG.error("State file %s was not found. Aborting", state_filename) sys.exit(1)