mirror of https://git.48k.eu/ogclient
#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.more_events
parent
c86eae48fe
commit
b138fbc0db
|
@ -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())
|
||||
|
|
Loading…
Reference in New Issue