Change in vdsm[master]: storage: move clusterlock.py to vdsm storage lib

ishaby at redhat.com ishaby at redhat.com
Tue Apr 26 15:03:25 UTC 2016


Idan Shaby has uploaded a new change for review.

Change subject: storage: move clusterlock.py to vdsm storage lib
......................................................................

storage: move clusterlock.py to vdsm storage lib

This patch moves the module vdsm/storage/clusterlock.py to
lib/vdsm/storage/clusterlock.py.

Change-Id: I6769b5eb827ef21b6507b1872cd5c38aa3264971
Signed-off-by: Idan Shaby <ishaby at redhat.com>
---
M lib/vdsm/storage/Makefile.am
R lib/vdsm/storage/clusterlock.py
M vdsm.spec.in
M vdsm/API.py
M vdsm/storage/Makefile.am
M vdsm/storage/blockSD.py
M vdsm/storage/hsm.py
M vdsm/storage/localFsSD.py
M vdsm/storage/monitor.py
M vdsm/storage/sd.py
10 files changed, 13 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/41/56641/1

diff --git a/lib/vdsm/storage/Makefile.am b/lib/vdsm/storage/Makefile.am
index 70fc0bf..190bec1 100644
--- a/lib/vdsm/storage/Makefile.am
+++ b/lib/vdsm/storage/Makefile.am
@@ -23,6 +23,7 @@
 
 dist_vdsmstorage_PYTHON = \
 	__init__.py \
+	clusterlock.py \
 	constants.py \
 	exception.py \
 	fileUtils.py \
diff --git a/vdsm/storage/clusterlock.py b/lib/vdsm/storage/clusterlock.py
similarity index 99%
rename from vdsm/storage/clusterlock.py
rename to lib/vdsm/storage/clusterlock.py
index f26408e..4de966e 100644
--- a/vdsm/storage/clusterlock.py
+++ b/lib/vdsm/storage/clusterlock.py
@@ -1,5 +1,5 @@
 #
-# Copyright 2011 Red Hat, Inc.
+# Copyright 2011-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,6 +18,8 @@
 # Refer to the README and COPYING files for full details of the license
 #
 
+from __future__ import absolute_import
+
 import fcntl
 import logging
 import os
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 379f84f..cb6bd5c 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -950,7 +950,6 @@
 %{_datadir}/%{vdsm_name}/storage/outOfProcess.py*
 %{_datadir}/%{vdsm_name}/storage/resourceFactories.py*
 %{_datadir}/%{vdsm_name}/storage/resourceManager.py*
-%{_datadir}/%{vdsm_name}/storage/clusterlock.py*
 %{_datadir}/%{vdsm_name}/storage/sdc.py*
 %{_datadir}/%{vdsm_name}/storage/sd.py*
 %{_datadir}/%{vdsm_name}/storage/sp.py*
@@ -1172,6 +1171,7 @@
 %{python_sitelib}/%{vdsm_name}/profiling/memory.py*
 %{python_sitelib}/%{vdsm_name}/profiling/profile.py*
 %{python_sitelib}/%{vdsm_name}/storage/__init__.py*
+%{python_sitelib}/%{vdsm_name}/storage/clusterlock.py*
 %{python_sitelib}/%{vdsm_name}/storage/constants.py*
 %{python_sitelib}/%{vdsm_name}/storage/exception.py*
 %{python_sitelib}/%{vdsm_name}/storage/fileUtils.py*
diff --git a/vdsm/API.py b/vdsm/API.py
index 84bb24d..cffe962 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -39,12 +39,12 @@
 from vdsm import supervdsm
 from vdsm import jobs
 from vdsm import v2v
+from vdsm.storage import clusterlock
 from vdsm.storage import misc
 from vdsm.virt import hoststats
 from vdsm.virt import vmstatus
 from vdsm.virt import sampling
 from vdsm.virt import secret
-import storage.clusterlock
 import storage.volume
 import storage.sd
 import storage.image
@@ -1154,7 +1154,7 @@
     def spmStart(self, prevID, prevLver, enableScsiFencing,
                  maxHostID=None, domVersion=None):
         if maxHostID is None:
-            maxHostID = storage.clusterlock.MAX_HOST_ID
+            maxHostID = clusterlock.MAX_HOST_ID
         return self._irs.spmStart(self._UUID, prevID, prevLver, maxHostID,
                                   domVersion)
 
@@ -1223,7 +1223,7 @@
             # seconds. If so, we consider the host Up and we won't execute
             # fencing, even when it's unreachable from engine
             for sd, status in result['domains'].iteritems():
-                if status == storage.clusterlock.HOST_STATUS_LIVE:
+                if status == clusterlock.HOST_STATUS_LIVE:
                     self.log.debug("Host has live lease on '%s'", sd)
                     return False
 
diff --git a/vdsm/storage/Makefile.am b/vdsm/storage/Makefile.am
index d7c28a3..031384f 100644
--- a/vdsm/storage/Makefile.am
+++ b/vdsm/storage/Makefile.am
@@ -27,7 +27,6 @@
 	__init__.py \
 	blockSD.py \
 	blockVolume.py \
-	clusterlock.py \
 	curlImgWrap.py \
 	devicemapper.py \
 	dispatcher.py \
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 73441a7..15b0f84 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -36,6 +36,7 @@
 from vdsm import constants
 from vdsm import exception
 from vdsm import utils
+from vdsm.storage import clusterlock
 from vdsm.storage import constants as storage_constants
 from vdsm.storage import exception as se
 from vdsm.storage import fileUtils
@@ -46,7 +47,6 @@
 
 import sd
 import lvm
-import clusterlock
 import blockVolume
 import multipath
 import resourceFactories
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 1bbb2ed..467f7cc 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -44,6 +44,7 @@
 from vdsm import supervdsm
 from vdsm import utils
 from vdsm.config import config
+from vdsm.storage import clusterlock
 from vdsm.storage import exception as se
 from vdsm.storage import fileUtils
 from vdsm.storage import misc
@@ -71,7 +72,6 @@
 import volume
 import iscsi
 import taskManager
-import clusterlock
 from threadLocal import vars
 import resourceManager as rm
 from resourceFactories import IMAGE_NAMESPACE
diff --git a/vdsm/storage/localFsSD.py b/vdsm/storage/localFsSD.py
index fb7b608..4121ed4 100644
--- a/vdsm/storage/localFsSD.py
+++ b/vdsm/storage/localFsSD.py
@@ -21,13 +21,13 @@
 import os
 from glob import glob
 
+from vdsm.storage import clusterlock
 from vdsm.storage import exception as se
 from vdsm.storage import fileUtils
 from vdsm.storage import misc
 
 import sd
 import fileSD
-import clusterlock
 
 
 class LocalFsStorageDomainManifest(fileSD.FileStorageDomainManifest):
diff --git a/vdsm/storage/monitor.py b/vdsm/storage/monitor.py
index 014f46d..2bcb9dd 100644
--- a/vdsm/storage/monitor.py
+++ b/vdsm/storage/monitor.py
@@ -26,9 +26,9 @@
 from vdsm import concurrent
 from vdsm import utils
 from vdsm.config import config
+from vdsm.storage import clusterlock
 from vdsm.storage import misc
 
-from . import clusterlock
 from .sdc import sdCache
 
 
diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py
index 57dd9f7..b6e0f0c 100644
--- a/vdsm/storage/sd.py
+++ b/vdsm/storage/sd.py
@@ -26,6 +26,7 @@
 import codecs
 from contextlib import contextmanager
 
+from vdsm.storage import clusterlock
 from vdsm.storage import exception as se
 from vdsm.storage import misc
 from vdsm.storage.persistent import unicodeEncoder, unicodeDecoder
@@ -37,7 +38,6 @@
 from vdsm import concurrent
 from vdsm import constants
 from vdsm.storage import constants as storage_constants
-import clusterlock
 import outOfProcess as oop
 import volume
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6769b5eb827ef21b6507b1872cd5c38aa3264971
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Idan Shaby <ishaby at redhat.com>


More information about the vdsm-patches mailing list