Change in vdsm[master]: storage: move persistent to lib

frolland at redhat.com frolland at redhat.com
Thu Mar 10 10:38:33 UTC 2016


Hello Fred Rolland,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/54582

to review the following change.

Change subject: storage: move persistent to lib
......................................................................

storage: move persistent to lib

Moving vdsm/storage/persistentDict.py to
lib/vdsm/storage/persistent.py

Change-Id: I525423502e20aceca872dd26f5cb408e8e69d12d
Signed-off-by: Fred Rolland <frolland at redhat.com>
---
M debian/vdsm-python.install
M debian/vdsm.install
M lib/vdsm/storage/Makefile.am
R lib/vdsm/storage/persistent.py
M tests/persistentDictTests.py
M vdsm.spec.in
M vdsm/storage/Makefile.am
M vdsm/storage/blockSD.py
M vdsm/storage/fileSD.py
M vdsm/storage/sd.py
M vdsm/storage/spbackends.py
11 files changed, 13 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/82/54582/1

diff --git a/debian/vdsm-python.install b/debian/vdsm-python.install
index 1faf48e..31a9b1f 100644
--- a/debian/vdsm-python.install
+++ b/debian/vdsm-python.install
@@ -62,6 +62,7 @@
 ./usr/lib/python2.7/dist-packages/vdsm/sslutils.py
 ./usr/lib/python2.7/dist-packages/vdsm/storage/__init__.py
 ./usr/lib/python2.7/dist-packages/vdsm/storage/constants.py
+./usr/lib/python2.7/dist-packages/vdsm/storage/persistent.py
 ./usr/lib/python2.7/dist-packages/vdsm/storage/securable.py
 ./usr/lib/python2.7/dist-packages/vdsm/storage/exception.py
 ./usr/lib/python2.7/dist-packages/vdsm/supervdsm.py
diff --git a/debian/vdsm.install b/debian/vdsm.install
index 1a4e754..291f1f9 100644
--- a/debian/vdsm.install
+++ b/debian/vdsm.install
@@ -104,7 +104,6 @@
 ./usr/share/vdsm/storage/multipath.py
 ./usr/share/vdsm/storage/nfsSD.py
 ./usr/share/vdsm/storage/outOfProcess.py
-./usr/share/vdsm/storage/persistentDict.py
 ./usr/share/vdsm/storage/remoteFileHandler.py
 ./usr/share/vdsm/storage/resourceFactories.py
 ./usr/share/vdsm/storage/resourceManager.py
diff --git a/lib/vdsm/storage/Makefile.am b/lib/vdsm/storage/Makefile.am
index 5970de6..6567365 100644
--- a/lib/vdsm/storage/Makefile.am
+++ b/lib/vdsm/storage/Makefile.am
@@ -24,6 +24,7 @@
 dist_vdsmstorage_PYTHON = \
 	__init__.py \
 	constants.py \
+	persistent.py \
 	securable.py \
 	exception.py \
 	$(NULL)
diff --git a/vdsm/storage/persistentDict.py b/lib/vdsm/storage/persistent.py
similarity index 98%
rename from vdsm/storage/persistentDict.py
rename to lib/vdsm/storage/persistent.py
index c25c3bd..6f708b9 100644
--- a/vdsm/storage/persistentDict.py
+++ b/lib/vdsm/storage/persistent.py
@@ -19,10 +19,11 @@
 #
 
 """
-persistentDict module provides generic class with common verification and
+persistent module provides generic class with common verification and
 validation functionality implemented.
 """
 
+from __future__ import absolute_import
 import hashlib
 import logging
 from contextlib import contextmanager
diff --git a/tests/persistentDictTests.py b/tests/persistentDictTests.py
index e1d4c8f..f25964d 100644
--- a/tests/persistentDictTests.py
+++ b/tests/persistentDictTests.py
@@ -1,5 +1,5 @@
 #
-# Copyright 2012 Red Hat, Inc.
+# Copyright 2012-2016 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
@@ -18,7 +18,7 @@
 # Refer to the README and COPYING files for full details of the license
 #
 from testlib import VdsmTestCase as TestCaseBase
-import storage.persistentDict as persistentDict
+from vdsm.storage import persistent as persistentDict
 
 
 class DummyFailWriter(object):
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 3af57e5..be8378f 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -937,7 +937,6 @@
 %{_datadir}/%{vdsm_name}/storage/multipath.py*
 %{_datadir}/%{vdsm_name}/storage/nfsSD.py*
 %{_datadir}/%{vdsm_name}/storage/outOfProcess.py*
-%{_datadir}/%{vdsm_name}/storage/persistentDict.py*
 %{_datadir}/%{vdsm_name}/storage/resourceFactories.py*
 %{_datadir}/%{vdsm_name}/storage/remoteFileHandler.py*
 %{_datadir}/%{vdsm_name}/storage/resourceManager.py*
@@ -1148,6 +1147,7 @@
 %{python_sitelib}/%{vdsm_name}/storage/__init__.py*
 %{python_sitelib}/%{vdsm_name}/storage/constants.py*
 %{python_sitelib}/%{vdsm_name}/storage/exception.py*
+%{python_sitelib}/%{vdsm_name}/storage/persistent.py*
 %{python_sitelib}/%{vdsm_name}/storage/securable.py*
 %{python_sitelib}/%{vdsm_name}/tc/__init__.py*
 %{python_sitelib}/%{vdsm_name}/tc/_parser.py*
diff --git a/vdsm/storage/Makefile.am b/vdsm/storage/Makefile.am
index 22336f4..b7212ee 100644
--- a/vdsm/storage/Makefile.am
+++ b/vdsm/storage/Makefile.am
@@ -52,7 +52,6 @@
 	multipath.py \
 	nfsSD.py \
 	outOfProcess.py \
-	persistentDict.py \
 	remoteFileHandler.py \
 	resourceFactories.py \
 	resourceManager.py \
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 3b00ed5..8c4a775 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -48,7 +48,7 @@
 import multipath
 import resourceFactories
 from resourceFactories import LVM_ACTIVATION_NAMESPACE
-from persistentDict import PersistentDict, DictValidator
+from vdsm.storage.persistent import PersistentDict, DictValidator
 import iscsi
 from storage_mailbox import MAILBOX_SIZE
 import resourceManager as rm
diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py
index d710baa..a7b8241 100644
--- a/vdsm/storage/fileSD.py
+++ b/vdsm/storage/fileSD.py
@@ -34,7 +34,7 @@
 import misc
 import outOfProcess as oop
 from remoteFileHandler import Timeout
-from persistentDict import PersistentDict, DictValidator
+from vdsm.storage.persistent import PersistentDict, DictValidator
 from vdsm import constants
 from vdsm.utils import stripNewLines
 from vdsm.storage.constants import LEASE_FILEEXT
diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py
index aa9c34c..97d6688 100644
--- a/vdsm/storage/sd.py
+++ b/vdsm/storage/sd.py
@@ -37,7 +37,7 @@
 from vdsm import constants
 import clusterlock
 import outOfProcess as oop
-from persistentDict import unicodeEncoder, unicodeDecoder
+from vdsm.storage.persistent import unicodeEncoder, unicodeDecoder
 import volume
 
 from vdsm.config import config
diff --git a/vdsm/storage/spbackends.py b/vdsm/storage/spbackends.py
index cc65fa4..46973a7 100644
--- a/vdsm/storage/spbackends.py
+++ b/vdsm/storage/spbackends.py
@@ -29,9 +29,9 @@
 import misc
 import sd
 
-from persistentDict import DictValidator
-from persistentDict import unicodeDecoder
-from persistentDict import unicodeEncoder
+from vdsm.storage.persistent import DictValidator
+from vdsm.storage.persistent import unicodeDecoder
+from vdsm.storage.persistent import unicodeEncoder
 from sp import LVER_INVALID
 from sp import SPM_ACQUIRED
 from sp import SPM_FREE


-- 
To view, visit https://gerrit.ovirt.org/54582
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I525423502e20aceca872dd26f5cb408e8e69d12d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Freddy Rolland <frolland at redhat.com>
Gerrit-Reviewer: Fred Rolland <frolland at redhat.com>


More information about the vdsm-patches mailing list