summaryrefslogtreecommitdiffstats
path: root/src/virtual
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-05-27 10:28:21 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-05-30 17:22:23 +0200
commit60803fe0ed3da3efc444b5f4b203f8fe1b16ca33 (patch)
tree390a24ddadfb51c4bdd8b4795f2bb611b704d54f /src/virtual
parent72d8943576610395582f95b170730bae4adf2287 (diff)
src: add cache info to the image/restore response
Add a 'cache' field into the json payload the client sends to the server after a restore operation so the server can update the new cache contents. Resquest response structure: { ... 'cache': [ {'name': 'windows.img', 'size': 2432370213, checksum: '5d4dcc677bc19f40a647d0002f4ade90'}, {'name': 'linux.img', 'size': 243234534213, checksum: '3eb22f888f88a55ad954f55644e1192e'} ] ... }
Diffstat (limited to 'src/virtual')
-rw-r--r--src/virtual/ogOperations.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/virtual/ogOperations.py b/src/virtual/ogOperations.py
index d40170e..1e2a682 100644
--- a/src/virtual/ogOperations.py
+++ b/src/virtual/ogOperations.py
@@ -457,7 +457,14 @@ class OgVirtualOperations:
subprocess.run([f'umount {self.OG_IMAGES_PATH}'], shell=True)
self.refresh(ogRest)
- return True
+ json_dict = {
+ 'disk': request.getDisk(),
+ 'partition': request.getPartition(),
+ 'image_id': request.getId(),
+ 'cache': [],
+ }
+
+ return json_dict
def cache_delete(self, request, ogRest):
raise NotImplementedError