New patch submitted by Eduardo Warszawski (ewarszaw@redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/644
commit dd4884ae7cbf5d090c8e405dbd85705c72969b65 Author: Eduardo Warszawski ewarszaw@redhat.com Date: Fri Jul 1 10:11:47 2011 +0300
Removing references to sdf.py.
Change-Id: I19d178e3b37fa119dc8a44815bb5055535c95241
diff --git a/vdsm/storage/blockVolume.py b/vdsm/storage/blockVolume.py index ae411be..107ae69 100644 --- a/vdsm/storage/blockVolume.py +++ b/vdsm/storage/blockVolume.py @@ -23,7 +23,7 @@ import task import lvm import resourceManager as rm from threadLocal import vars -from sdf import StorageDomainFactory as SDF +from sdc import StorageDomainFactory as SDF from resourceFactories import LVM_ACTIVATION_NAMESPACE import fileUtils
diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py index 9ed54ff..fc4008f 100644 --- a/vdsm/storage/fileVolume.py +++ b/vdsm/storage/fileVolume.py @@ -13,7 +13,7 @@ import uuid from config import config
import storage_exception as se -from sdf import StorageDomainFactory as SDF +from sdc import StorageDomainFactory as SDF import volume import image import sd diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py index 296e923..f139b40 100644 --- a/vdsm/storage/hsm.py +++ b/vdsm/storage/hsm.py @@ -28,7 +28,7 @@ import spm import lvm import fileUtils import multipath -from sdf import StorageDomainFactory as SDF +from sdc import StorageDomainFactory as SDF import volume import iscsi import misc @@ -1346,7 +1346,7 @@ class HSM: domains = domList.keys() else: #getSharedLock(connectionsResource...) - domains = SDF.getAllUUIDs() + domains = SDF.getUUIDs()
for sdUUID in domains[:]: try: diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py index 40a82c9..2e7c302 100644 --- a/vdsm/storage/image.py +++ b/vdsm/storage/image.py @@ -14,7 +14,7 @@ import threading import uuid
import volume -from sdf import StorageDomainFactory as SDF +from sdc import StorageDomainFactory as SDF import sd import misc import fileUtils diff --git a/vdsm/storage/resourceFactories.py b/vdsm/storage/resourceFactories.py index ce3ec70..42cd72a 100644 --- a/vdsm/storage/resourceFactories.py +++ b/vdsm/storage/resourceFactories.py @@ -13,7 +13,7 @@ import logging import lvm import resourceManager as rm import storage_exception as se -from sdf import StorageDomainFactory as SDF +from sdc import StorageDomainFactory as SDF import sd import image
diff --git a/vdsm/storage/sdc.py b/vdsm/storage/sdc.py index 883f7d2..8db7b11 100644 --- a/vdsm/storage/sdc.py +++ b/vdsm/storage/sdc.py @@ -13,6 +13,7 @@ for keeping storage related data that is expensive to harvest, but needed often import logging import threading import weakref +from config import config
import multipath import lvm @@ -22,6 +23,7 @@ import storage_exception as se # Default cache age until forcibly refreshed DEFAULT_REFRESH_INTERVAL = 300
+ class StorageDomainCache: """ Storage Domain List keeps track of all the storage domains accessible by the @@ -58,7 +60,7 @@ class StorageDomainCache: del self.__weakCache[sdUUID]
- def lookup(self, sdUUID): + def produce(self, sdUUID): dom = self._getDomainFromCache(sdUUID) if dom: return dom @@ -121,3 +123,8 @@ class StorageDomainCache: def manuallyRemoveDomain(self, sdUUID): with self._syncroot: del self.__cache[sdUUID] + + +storage_repository = config.get('irs', 'repository') +StorageDomainFactory = StorageDomainCache(storage_repository) + diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py index c377ee4..39d1135 100644 --- a/vdsm/storage/sp.py +++ b/vdsm/storage/sp.py @@ -24,7 +24,7 @@ import misc from misc import Event import fileUtils from config import config -from sdf import StorageDomainFactory as SDF +from sdc import StorageDomainFactory as SDF import storage_exception as se from persistentDict import DictValidator
diff --git a/vdsm/storage/spm.py b/vdsm/storage/spm.py index 085d03b..dd603f2 100644 --- a/vdsm/storage/spm.py +++ b/vdsm/storage/spm.py @@ -29,7 +29,7 @@ import sd import hsm import blockSD import image -from sdf import StorageDomainFactory as SDF +from sdc import StorageDomainFactory as SDF import volume import misc import logging diff --git a/vdsm/storage/volume.py b/vdsm/storage/volume.py index 123ed37..6fb4dfb 100644 --- a/vdsm/storage/volume.py +++ b/vdsm/storage/volume.py @@ -16,7 +16,7 @@ import signal import constants import storage_exception as se import sd -from sdf import StorageDomainFactory as SDF +from sdc import StorageDomainFactory as SDF import misc import fileUtils import task
New patch submitted by Eduardo Warszawski (ewarszaw@redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/644
commit 2251ee5307d71a8a34896172552cea8b548f0bc4 Author: Eduardo Warszawski ewarszaw@redhat.com Date: Fri Jul 1 10:11:47 2011 +0300
BZ#717658 - Remove sdf.py
Change-Id: I19d178e3b37fa119dc8a44815bb5055535c95241
diff --git a/vdsm.spec.in b/vdsm.spec.in index f1a3473..00f0b25 100644 --- a/vdsm.spec.in +++ b/vdsm.spec.in @@ -296,7 +296,6 @@ machines without running real guests. %{_datadir}/%{vdsm_name}/storage/devicemapper.py* %{_datadir}/%{vdsm_name}/storage/multipath.py* %{_datadir}/%{vdsm_name}/storage/sdc.py* -%{_datadir}/%{vdsm_name}/storage/sdf.py* %{_datadir}/%{vdsm_name}/storage/persistentDict.py* %{_libexecdir}/%{vdsm_name}/safelease %{_libexecdir}/%{vdsm_name}/spmprotect.sh diff --git a/vdsm/storage/Makefile.am b/vdsm/storage/Makefile.am index 766687a..22ed2a3 100644 --- a/vdsm/storage/Makefile.am +++ b/vdsm/storage/Makefile.am @@ -34,7 +34,6 @@ dist_vdsmstorage_DATA = \ resourceManager.py \ safelease.py \ sdc.py \ - sdf.py \ sd.py \ spm.py \ sp.py \ diff --git a/vdsm/storage/blockVolume.py b/vdsm/storage/blockVolume.py index 9b51d99..1d00dc9 100644 --- a/vdsm/storage/blockVolume.py +++ b/vdsm/storage/blockVolume.py @@ -33,7 +33,7 @@ import task import lvm import resourceManager as rm from threadLocal import vars -from sdf import StorageDomainFactory as SDF +from sdc import StorageDomainFactory as SDF from resourceFactories import LVM_ACTIVATION_NAMESPACE import fileUtils
diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py index f9e3841..a8d71c5 100644 --- a/vdsm/storage/fileVolume.py +++ b/vdsm/storage/fileVolume.py @@ -22,7 +22,7 @@ import os import uuid
import storage_exception as se -from sdf import StorageDomainFactory as SDF +from sdc import StorageDomainFactory as SDF import outOfProcess as oop import volume import image diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py index 5d398e0..9678fe7 100644 --- a/vdsm/storage/hsm.py +++ b/vdsm/storage/hsm.py @@ -40,7 +40,7 @@ import spm import lvm import fileUtils import multipath -from sdf import StorageDomainFactory as SDF +from sdc import StorageDomainFactory as SDF import volume import iscsi import misc @@ -1385,7 +1385,7 @@ class HSM: domains = domList.keys() else: #getSharedLock(connectionsResource...) - domains = SDF.getAllUUIDs() + domains = SDF.getUUIDs()
for sdUUID in domains[:]: try: diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py index a68f168..e86f6a7 100644 --- a/vdsm/storage/image.py +++ b/vdsm/storage/image.py @@ -25,7 +25,7 @@ import uuid from contextlib import contextmanager
import volume -from sdf import StorageDomainFactory as SDF +from sdc import StorageDomainFactory as SDF import sd import misc import fileUtils diff --git a/vdsm/storage/resourceFactories.py b/vdsm/storage/resourceFactories.py index 3d71edf..150f057 100644 --- a/vdsm/storage/resourceFactories.py +++ b/vdsm/storage/resourceFactories.py @@ -24,7 +24,7 @@ import logging import lvm import resourceManager as rm import storage_exception as se -from sdf import StorageDomainFactory as SDF +from sdc import StorageDomainFactory as SDF import sd import image
diff --git a/vdsm/storage/sdc.py b/vdsm/storage/sdc.py index bf9c8df..bf3ce7e 100644 --- a/vdsm/storage/sdc.py +++ b/vdsm/storage/sdc.py @@ -25,6 +25,7 @@ for keeping storage related data that is expensive to harvest, but needed often import logging import threading import weakref +from config import config
import multipath import lvm @@ -71,7 +72,7 @@ class StorageDomainCache: del self.__weakCache[sdUUID]
- def lookup(self, sdUUID): + def produce(self, sdUUID): dom = self._getDomainFromCache(sdUUID) if dom: return dom @@ -134,3 +135,8 @@ class StorageDomainCache: def manuallyRemoveDomain(self, sdUUID): with self._syncroot: del self.__cache[sdUUID] + + +storage_repository = config.get('irs', 'repository') +StorageDomainFactory = StorageDomainCache(storage_repository) + diff --git a/vdsm/storage/sdf.py b/vdsm/storage/sdf.py deleted file mode 100644 index bd49edf..0000000 --- a/vdsm/storage/sdf.py +++ /dev/null @@ -1,68 +0,0 @@ -# -# Copyright 2009-2011 Red Hat, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -# -# Refer to the README and COPYING files for full details of the license -# - -from config import config -import logging - -import sdc - - -class StorageDomainFactory: - log = logging.getLogger("Storage.StorageDomainFactory") - storage_repository = config.get('irs', 'repository') - __sdc = sdc.StorageDomainCache(storage_repository) - - #WARNING! The parameters of the following two methods are not symmetric. - @classmethod - def manuallyAddDomain(cls, sd): - cls.__sdc.manuallyAddDomain(sd) - - @classmethod - def manuallyRemoveDomain(cls, sdUUID): - cls.__sdc.manuallyRemoveDomain(sdUUID) - - @classmethod - def produce(cls, sdUUID): - """ - Produce a new Storage domain - """ - - return cls.__sdc.lookup(sdUUID) - - - @classmethod - def getAllUUIDs(cls): - return cls.__sdc.getUUIDs() - - - @classmethod - def refresh(cls): - cls.__sdc.refresh() - - - @classmethod - def invalidateStorage(cls): - cls.__sdc.invalidateStorage() - - - @classmethod - def refreshStorage(cls): - cls.__sdc.refreshStorage() - diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py index ef1b314..2e43cdd 100644 --- a/vdsm/storage/sp.py +++ b/vdsm/storage/sp.py @@ -36,7 +36,7 @@ import misc from misc import Event import fileUtils from config import config -from sdf import StorageDomainFactory as SDF +from sdc import StorageDomainFactory as SDF import storage_exception as se from persistentDict import DictValidator from processPool import Timeout diff --git a/vdsm/storage/spm.py b/vdsm/storage/spm.py index 849b9d2..74d1d00 100644 --- a/vdsm/storage/spm.py +++ b/vdsm/storage/spm.py @@ -42,7 +42,7 @@ import sd import hsm import blockSD import image -from sdf import StorageDomainFactory as SDF +from sdc import StorageDomainFactory as SDF import volume import misc import logging diff --git a/vdsm/storage/volume.py b/vdsm/storage/volume.py index d50204b..14a8f04 100644 --- a/vdsm/storage/volume.py +++ b/vdsm/storage/volume.py @@ -26,7 +26,7 @@ import signal import constants import storage_exception as se import sd -from sdf import StorageDomainFactory as SDF +from sdc import StorageDomainFactory as SDF import misc import fileUtils import task
Yotam Oron has posted comments on this change.
Change subject: Remove sdf.py ......................................................................
Patch Set 5: Looks good to me, but someone else must approve
Nice work !
-- To view, visit http://gerrit.usersys.redhat.com/644 To unsubscribe, visit http://gerrit.usersys.redhat.com/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I19d178e3b37fa119dc8a44815bb5055535c95241 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Yotam Oron yoron@redhat.com
David Naori has posted comments on this change.
Change subject: Remove sdf.py ......................................................................
Patch Set 5: Verified
-- To view, visit http://gerrit.usersys.redhat.com/644 To unsubscribe, visit http://gerrit.usersys.redhat.com/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I19d178e3b37fa119dc8a44815bb5055535c95241 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: David Naori dnaori@redhat.com Gerrit-Reviewer: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Yotam Oron yoron@redhat.com
Dan Kenigsberg has posted comments on this change.
Change subject: Remove sdf.py ......................................................................
Patch Set 5: Looks good to me, approved
-- To view, visit http://gerrit.usersys.redhat.com/644 To unsubscribe, visit http://gerrit.usersys.redhat.com/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I19d178e3b37fa119dc8a44815bb5055535c95241 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: David Naori dnaori@redhat.com Gerrit-Reviewer: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Yotam Oron yoron@redhat.com
Dan Kenigsberg has posted comments on this change.
Change subject: Remove sdf.py ......................................................................
Patch Set 6: Verified; Looks good to me, approved
-- Gerrit-MessageType: comment Gerrit-Change-Id: I19d178e3b37fa119dc8a44815bb5055535c95241 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: David Naori dnaori@redhat.com Gerrit-Reviewer: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Yotam Oron yoron@redhat.com
Dan Kenigsberg has posted comments on this change.
Change subject: Remove sdf.py ......................................................................
-- Gerrit-MessageType: comment Gerrit-Change-Id: I19d178e3b37fa119dc8a44815bb5055535c95241 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: David Naori dnaori@redhat.com Gerrit-Reviewer: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Yotam Oron yoron@redhat.com
Dan Kenigsberg has submitted this change and it was merged.
Change subject: Remove sdf.py ......................................................................
Remove sdf.py
Change-Id: I19d178e3b37fa119dc8a44815bb5055535c95241 --- M vdsm.spec.in M vdsm/storage/Makefile.am M vdsm/storage/blockVolume.py M vdsm/storage/fileVolume.py M vdsm/storage/hsm.py M vdsm/storage/image.py M vdsm/storage/resourceFactories.py M vdsm/storage/sdc.py D vdsm/storage/sdf.py M vdsm/storage/sp.py M vdsm/storage/spm.py M vdsm/storage/volume.py 12 files changed, 16 insertions(+), 80 deletions(-)
Approvals: Dan Kenigsberg: Verified; Looks good to me, approved
-- To view, visit http://gerrit.usersys.redhat.com/644 To unsubscribe, visit http://gerrit.usersys.redhat.com/settings
Gerrit-MessageType: merged Gerrit-Change-Id: I19d178e3b37fa119dc8a44815bb5055535c95241 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: David Naori dnaori@redhat.com Gerrit-Reviewer: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Igor Lvovsky ilvovsky@redhat.com Gerrit-Reviewer: Yotam Oron yoron@redhat.com
vdsm-patches@lists.fedorahosted.org