summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/live/ogOperations.py8
-rw-r--r--src/ogRest.py7
-rw-r--r--src/virtual/ogOperations.py9
3 files changed, 18 insertions, 6 deletions
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())
diff --git a/src/ogRest.py b/src/ogRest.py
index ad57c8c..bd480a7 100644
--- a/src/ogRest.py
+++ b/src/ogRest.py
@@ -170,15 +170,12 @@ class ogThread():
def image_restore(client, request, ogRest):
try:
- ogRest.operations.image_restore(request, ogRest)
+ payload = ogRest.operations.image_restore(request, ogRest)
except Exception as e:
ogRest.send_internal_server_error(client, exc=e)
return
- json_body = jsonBody()
- json_body.add_element('disk', request.getDisk())
- json_body.add_element('partition', request.getPartition())
- json_body.add_element('image_id', request.getId())
+ json_body = jsonBody(payload)
response = restResponse(ogResponses.OK, json_body, seq=client.seq)
client.send(response.get())
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