Federico Simoncelli has uploaded a new change for review.

Change subject: sp: refresh metadata on hsm when listing domains
......................................................................

sp: refresh metadata on hsm when listing domains

In this patch:
- validatePoolSD and validateAttachedDomain are relevant only for SPM
  operations (remove @unsecured)

Change-Id: I095cd0760076fb4be97a776498af78a40ff84112
Signed-off-by: Federico Simoncelli <[email protected]>
---
M vdsm/storage/sp.py
1 file changed, 2 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/86/21786/1

diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 8ae733b..37dcec8 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -506,15 +506,11 @@
         return self.getMetaParam(PMDK_MASTER_VER)
 
     # TODO: Remove or rename this function.
-    @unsecured
     def validatePoolSD(self, sdUUID):
         if sdUUID not in self.getDomains():
-            self._metadata.invalidate()
-            if sdUUID not in self.getDomains():
-                raise se.StorageDomainNotMemberOfPool(self.spUUID, sdUUID)
+            raise se.StorageDomainNotMemberOfPool(self.spUUID, sdUUID)
         return True
 
-    @unsecured
     def validateAttachedDomain(self, dom):
         """
         Avoid handling domains if not owned by pool.
@@ -1542,7 +1538,6 @@
     def updateMonitoringThreads(self):
         # domain list it's list of sdUUID:status
         # sdUUID1:status1,sdUUID2:status2,...
-        self.invalidateMetadata()
         activeDomains = self.getDomains(activeOnly=True)
         monitoredDomains = self.domainMonitor.poolMonitoredDomains
 
@@ -1569,6 +1564,7 @@
 
     @unsecured
     def getDomains(self, activeOnly=False):
+        self.invalidateMetadata()
         return dict(
             (sdUUID, status) for sdUUID, status in
             self.getMetaParam(PMDK_DOMAINS).iteritems()


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I095cd0760076fb4be97a776498af78a40ff84112
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to