Change in vdsm[master]: convert sampling classed to new style classes
ibarkan at redhat.com
ibarkan at redhat.com
Mon Dec 15 13:39:16 UTC 2014
Ido Barkan has uploaded a new change for review.
Change subject: convert sampling classed to new style classes
......................................................................
convert sampling classed to new style classes
The use of old style classes is discourged in modern Python
Change-Id: Ice50e7a51d6b18e490a14a9fb088e721cbb7747c
Signed-off-by: ibarkan <ibarkan at redhat.com>
---
M vdsm/virt/sampling.py
1 file changed, 7 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/78/36178/1
diff --git a/vdsm/virt/sampling.py b/vdsm/virt/sampling.py
index eac4873..78cea52 100644
--- a/vdsm/virt/sampling.py
+++ b/vdsm/virt/sampling.py
@@ -42,7 +42,7 @@
_THP_STATE_PATH = '/sys/kernel/mm/redhat_transparent_hugepage/enabled'
-class InterfaceSample:
+class InterfaceSample(object):
"""
A network interface sample.
@@ -114,7 +114,7 @@
if getattr(self, attr) != getattr(other, attr))
-class TotalCpuSample:
+class TotalCpuSample(object):
"""
A sample of total CPU consumption.
@@ -127,7 +127,7 @@
self.user += userNice
-class CpuCoreSample:
+class CpuCoreSample(object):
"""
A sample of the CPU consumption of each core
@@ -156,7 +156,7 @@
return self.coresSample[strCoreId]
-class NumaNodeMemorySample:
+class NumaNodeMemorySample(object):
"""
A sample of the memory stats of each numa node
@@ -177,7 +177,7 @@
self.nodesMemSample[nodeIndex] = nodeMemSample
-class PidCpuSample:
+class PidCpuSample(object):
"""
A sample of the CPU consumption of a process.
@@ -189,7 +189,7 @@
map(int, stat.read().split()[13:15])
-class TimedSample:
+class TimedSample(object):
def __init__(self):
self.timestamp = time.time()
@@ -242,7 +242,7 @@
:param pid: The PID of this vdsm host.
:type pid: int
"""
- TimedSample.__init__(self)
+ super(HostSample, self).__init__()
self.interfaces = dict(
(link.name, InterfaceSample(link)) for link in getLinks())
self.pidcpu = PidCpuSample(pid)
--
To view, visit http://gerrit.ovirt.org/36178
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice50e7a51d6b18e490a14a9fb088e721cbb7747c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan at redhat.com>
More information about the vdsm-patches
mailing list