From 60803fe0ed3da3efc444b5f4b203f8fe1b16ca33 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Mon, 27 May 2024 10:28:21 +0200 Subject: 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'} ] ... } --- src/live/ogOperations.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/live') diff --git a/src/live/ogOperations.py b/src/live/ogOperations.py index d557fac..e8a3b40 100644 --- a/src/live/ogOperations.py +++ b/src/live/ogOperations.py @@ -452,6 +452,14 @@ class OgLiveOperations: logging.info('Image restore command OK') + json_dict = { + 'disk': request.getDisk(), + 'partition': request.getPartition(), + 'image_id': request.getId(), + 'cache': self._get_cache_contents(), + } + return json_dict + def image_create(self, request, ogRest): disk = int(request.getDisk()) partition = int(request.getPartition()) -- cgit v1.2.3-18-g5258