Saggi Mizrahi has posted comments on this change.
Change subject: Adding new resourceFactory that only opens fd ......................................................................
Patch Set 5: I would prefer that you didn't submit this
(5 inline comments)
.................................................... File vdsm/storage/blockVolume.py Line 87: volWatcherFactory = rf.VolumeWatcherFactory(sdUUID, volUUID) Line 88: self.volWatcherNamespace = rf.VOLUME_WATCHER_NAMESPACE Line 89: try: Line 90: rmanager.registerNamespace(self.volWatcherNamespace, Line 91: volWatcherFactory) You could register this in the dispatcher now that it has a constant namespace Line 92: except Exception: Line 93: self.log.warn("Resource namespace %s already registered", Line 94: self.volWatcherNamespace) Line 95:
.................................................... File vdsm/storage/resourceFactories.py Line 30: Line 31: LVM_ACTIVATION_NAMESPACE = 'lvmActivationNS' Line 32: IMAGE_NAMESPACE = 'imageNS' Line 33: VOLUME_NAMESPACE = 'volumeNS' Line 34: VOLUME_WATCHER_NAMESPACE = 'volWatchNS' I'd call it VolumeHandler Line 35: Line 36: rmanager = rm.ResourceManager.getInstance() Line 37: Line 38: log = logging.getLogger('Storage.ResourcesFactories')
Line 62: """ Line 63: Return :keyword:`True` if a resource with that name is producible with Line 64: this factory. Line 65: """ Line 66: return True Check if the file exists, could detect bugs in a cleaner way Line 67: Line 68: def createResource(self, resourceName, lockType): Line 69: try: Line 70: lvvg = resourceName.split('/')
Line 66: return True Line 67: Line 68: def createResource(self, resourceName, lockType): Line 69: try: Line 70: lvvg = resourceName.split('/') lv, vg = .... Line 71: return VolumeWatcher(lvvg[0], lvvg[1]) Line 72: except: Line 73: log.error("error creating resource name: %s", resourceName) Line 74:
Line 69: try: Line 70: lvvg = resourceName.split('/') Line 71: return VolumeWatcher(lvvg[0], lvvg[1]) Line 72: except: Line 73: log.error("error creating resource name: %s", resourceName) Propagate the error or the resource manager will think that everything was OK Line 74: Line 75: Line 76: class LvmActivation(object): Line 77: """
-- To view, visit http://gerrit.ovirt.org/8084 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ic936c8959562a262de5ceba8ca4f68bc53b5cae2 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Yaniv Bronhaim ybronhei@redhat.com Gerrit-Reviewer: Saggi Mizrahi smizrahi@redhat.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com