Handle other exceptions on virtual /refresh

Ths patch handles different cases when a /refresh request can be made. More
specifically this handles the situation in which the VM is stopped when /refresh
is called but it starts during the processing of /refresh, in this case we just
send the last recorded setup.
more_events
Roberto Hueso Gómez 2020-05-19 12:40:35 +02:00
parent de2ce69e46
commit 2ab5db74fe
1 changed files with 3 additions and 0 deletions

View File

@ -326,6 +326,9 @@ class OgVirtualOperations:
data['partition_setup'].append(part_json)
with open(self.OG_PARTITIONS_CFG_PATH, 'w+') as f:
f.write(json.dumps(data, indent=4))
except:
with open(self.OG_PARTITIONS_CFG_PATH, 'r') as f:
data = json.load(f)
data = self.partitions_cfg_to_json(data)