summaryrefslogtreecommitdiffstats
path: root/src/virtual
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-05-19 12:40:35 +0200
committerRoberto Hueso Gómez <rhueso@soleta.eu>2020-05-19 12:40:35 +0200
commit2ab5db74fea2e0cab82801b67969a818d721b405 (patch)
tree27eca79dc278da2a83219eb58fba4145e6c7bf62 /src/virtual
parentde2ce69e460e6e6dd2b959bb18707314a16c8887 (diff)
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.
Diffstat (limited to 'src/virtual')
-rw-r--r--src/virtual/ogOperations.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/virtual/ogOperations.py b/src/virtual/ogOperations.py
index d1005cc..8e2eb23 100644
--- a/src/virtual/ogOperations.py
+++ b/src/virtual/ogOperations.py
@@ -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)