Skip to content

Commit b8a6ed6

Browse files
author
gitlab
committed
Merge branch 'fix_34028_@@3' into 'master'
[BugFix: ZSTACK-34028] See merge request zstackio/zstack-utility!333
2 parents c3fbace + 9005c2e commit b8a6ed6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

kvmagent/kvmagent/plugins/localstorage.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ def __init__(self):
3232
self.error = None
3333

3434

35+
class InitRsp(AgentResponse):
36+
def __init__(self):
37+
super(InitRsp, self).__init__()
38+
self.localStorageUsedCapacity = None
39+
40+
3541
class CopyBitsFromRemoteCmd(AgentCommand):
3642
@log.sensitive_fields("dstPassword")
3743
def __init__(self):
@@ -696,8 +702,9 @@ def init(self, req):
696702
f = open(cmd.initFilePath, 'w')
697703
f.close()
698704

699-
rsp = AgentResponse()
705+
rsp = InitRsp()
700706
rsp.totalCapacity, rsp.availableCapacity = self._get_disk_capacity(cmd.path)
707+
rsp.localStorageUsedCapacity = linux.get_used_disk_apparent_size(cmd.path, 0, 1)
701708
return jsonobject.dumps(rsp)
702709

703710
@kvmagent.replyerror

0 commit comments

Comments
 (0)