Subject: manager: Fix mem, disk, net stats graphs (bz 1543896) From: Cole Robinson crobinso@redhat.com Fri Feb 9 14:02:04 2018 -0500 Date: Fri Feb 9 14:02:04 2018 -0500: Git: 4c7c45908f6afd4e0edae9923218472d353caa3a python2/3 division compat messed this up https://bugzilla.redhat.com/show_bug.cgi?id=1543896 diff --git a/virtManager/domain.py b/virtManager/domain.py index ed94cf1..6d3dac2 100644 --- a/virtManager/domain.py +++ b/virtManager/domain.py @@ -1984,7 +1984,7 @@ class vmmDomain(vmmLibvirtObject): except libvirt.libvirtError as err: logging.error("Error reading mem stats: %s", err) - pcentCurrMem = (curmem // float(totalmem)) * 100 + pcentCurrMem = (curmem / float(totalmem)) * 100 pcentCurrMem = max(0.0, min(pcentCurrMem, 100.0)) return pcentCurrMem, curmem diff --git a/virtManager/manager.py b/virtManager/manager.py index d6640fb..d38fc4e 100644 --- a/virtManager/manager.py +++ b/virtManager/manager.py @@ -1068,7 +1068,7 @@ class vmmManager(vmmGObjectUI): return d1, d2 = obj.disk_io_vectors(GRAPH_LEN, self.max_disk_rate) - data = [(x + y) // 2 for x, y in zip(d1, d2)] + data = [(x + y) / 2 for x, y in zip(d1, d2)] cell.set_property('data_array', data) def network_traffic_img(self, column_ignore, cell, model, _iter, data): @@ -1077,5 +1077,5 @@ class vmmManager(vmmGObjectUI): return d1, d2 = obj.network_traffic_vectors(GRAPH_LEN, self.max_net_rate) - data = [(x + y) // 2 for x, y in zip(d1, d2)] + data = [(x + y) / 2 for x, y in zip(d1, d2)] cell.set_property('data_array', data)