resolve ResourceProviderSyncFailed issue

This is caused by the "/" operation difference between python 2.x and python 3.x

In python 2.x "/" int / int returns int while
in python 3.x int / int return the real result.

Change-Id: I1aa96bdc2fdb2ca856b73b91e3120c75ec104537
This commit is contained in:
yingjisun 2020-07-22 19:12:31 +08:00
parent b7a9ff513b
commit 73aad31a34
1 changed files with 2 additions and 2 deletions

View File

@ -88,8 +88,8 @@ class VCState(object):
return data
data["vcpus"] = stats['cpu']['vcpus']
data["disk_total"] = capacity / units.Gi
data["disk_available"] = freespace / units.Gi
data["disk_total"] = capacity // units.Gi
data["disk_available"] = freespace // units.Gi
data["disk_used"] = data["disk_total"] - data["disk_available"]
data["host_memory_total"] = stats['mem']['total']
data["host_memory_free"] = stats['mem']['free']