From b138fbc0db906f790b984ee520e9175b2ea974f2 Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Mon, 28 Sep 2020 16:09:38 +0200 Subject: #1004 Send datasize in bytes Image datasize is expressed in kibibytes but the existing REST API field represent data in bytes. This commit changes ogClient to send datasize in bytes. --- src/ogRest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ogRest.py') diff --git a/src/ogRest.py b/src/ogRest.py index ff9cccb..c50adfa 100644 --- a/src/ogRest.py +++ b/src/ogRest.py @@ -201,6 +201,9 @@ class ogThread(): ogRest.state = ThreadState.IDLE return + kibi = 1024 + datasize = int(image_info['datasize']) * kibi + json_body = jsonBody() json_body.add_element('disk', request.getDisk()) json_body.add_element('partition', request.getPartition()) @@ -212,7 +215,7 @@ class ogThread(): json_body.add_element('clonator', image_info['clonator']) json_body.add_element('compressor', image_info['compressor']) json_body.add_element('filesystem', image_info['filesystem']) - json_body.add_element('datasize', int(image_info['datasize'])) + json_body.add_element('datasize', datasize) response = restResponse(ogResponses.OK, json_body) client.send(response.get()) -- cgit v1.2.3-18-g5258