Change in vdsm[master]: domainMonitor: Rename confusing lastCheck variable

nsoffer at redhat.com nsoffer at redhat.com
Sat Nov 30 13:27:54 UTC 2013


Nir Soffer has uploaded a new change for review.

Change subject: domainMonitor: Rename confusing lastCheck variable
......................................................................

domainMonitor: Rename confusing lastCheck variable

In repoStats we use the "lastCheck" value as the time since domain
status was checked. In DomainMonitorStatus we use "lastCheck" value as
the time were domain was checked.  This patch eliminates the confusion
by using "time" for the time where status was checked.

Change-Id: I56ce7c2903c33c25693601dde5a1af376b789e59
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
---
M vdsm/storage/domainMonitor.py
M vdsm/storage/hsm.py
2 files changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/79/21879/1

diff --git a/vdsm/storage/domainMonitor.py b/vdsm/storage/domainMonitor.py
index 5b0d4ac..e08c045 100644
--- a/vdsm/storage/domainMonitor.py
+++ b/vdsm/storage/domainMonitor.py
@@ -33,7 +33,7 @@
 
 class DomainMonitorStatus(object):
     __slots__ = (
-        "error", "lastCheck", "valid", "readDelay", "masterMounted",
+        "error", "time", "valid", "readDelay", "masterMounted",
         "masterValid", "diskUtilization", "vgMdUtilization",
         "vgMdHasEnoughFreeSpace", "vgMdFreeBelowThreashold", "hasHostId",
         "isoPrefix", "version",
@@ -44,7 +44,7 @@
 
     def clear(self):
         self.error = None
-        self.lastCheck = NOT_CHECKED_YET
+        self.time = NOT_CHECKED_YET
         self.valid = True
         self.readDelay = 0
         self.diskUtilization = (None, None)
@@ -237,7 +237,7 @@
                            "information", self.sdUUID, exc_info=True)
             self.nextStatus.error = e
 
-        self.nextStatus.lastCheck = time()
+        self.nextStatus.time = time()
         self.nextStatus.valid = (self.nextStatus.error is None)
 
         if self._statusDidChange():
@@ -264,5 +264,5 @@
         self.status.update(self.nextStatus)
 
     def _statusDidChange(self):
-        return (self.status.lastCheck == NOT_CHECKED_YET or
+        return (self.status.time == NOT_CHECKED_YET or
                 self.status.valid != self.nextStatus.valid)
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 1fff3c3..8287da4 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -3627,10 +3627,10 @@
 
             disktotal, diskfree = domStatus.diskUtilization
             vgmdtotal, vgmdfree = domStatus.vgMdUtilization
-            lastcheck = '%.1f' % (statsGenTime - domStatus.lastCheck)
+            lastcheck = '%.1f' % (statsGenTime - domStatus.time)
 
             repoStats[sdUUID] = {
-                'finish': domStatus.lastCheck,
+                'finish': domStatus.time,
 
                 'result': {
                     'code': code,


-- 
To view, visit http://gerrit.ovirt.org/21879
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I56ce7c2903c33c25693601dde5a1af376b789e59
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>


More information about the vdsm-patches mailing list