Change in vdsm[master]: Enable logging facility for test cases
by wudxw@linux.vnet.ibm.com
Mark Wu has uploaded a new change for review.
Change subject: Enable logging facility for test cases
......................................................................
Enable logging facility for test cases
In current code, there's no log handler configured. So make use of
the logging configured by nose.config for test cases.
Change-Id: Iaf727a2dfe38206737e0711466978277cd95ad34
Signed-off-by: Mark Wu <wudxw(a)linux.vnet.ibm.com>
---
M tests/testrunner.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/12/3712/1
--
To view, visit http://gerrit.ovirt.org/3712
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaf727a2dfe38206737e0711466978277cd95ad34
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mark Wu <wudxw(a)linux.vnet.ibm.com>
10 years, 11 months
Change in vdsm[master]: BZ#836161 - Clean up.
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: BZ#836161 - Clean up.
......................................................................
BZ#836161 - Clean up.
Change-Id: Icf01de7dc8bf0a903ebf94d9e33ffad9a195b7de
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/sp.py
1 file changed, 0 insertions(+), 71 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/07/8507/1
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 78fbe66..0ade40d 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -1766,73 +1766,6 @@
image.Image(repoPath).multiMove(srcDomUUID, dstDomUUID, imgDict, vmUUID, force)
- def deleteImage(self, sdUUID, imgUUID, postZero, force):
- """
- Deletes an Image folder with all its volumes.
-
- This function assumes that imgUUID is locked.
- In addition to removing image, this function also does the following:
- If removing a template from a backup SD which has dependent images:
- - creates a fake template.
- If removing the last image which depends on a fake template:
- - removes the fake template as well
- :param sdUUID: The UUID of the storage domain that contains the images.
- :type sdUUID: UUID
- :param imgUUID: The UUID of the image you want to delete.
- :type imgUUID: UUID
- :param postZero: bool
- :param force: Should the operation be forced.
- :type force: bool
- """
- # TODO: This function works on domains. No relation with pools.
- # Therefore move this to the relevant *sd module
- repoPath = os.path.join(self.storage_repository, self.spUUID)
- img = image.Image(repoPath)
- dom = sdCache.produce(sdUUID)
- allVols = dom.getAllVolumes()
- # Filter volumes related to this image
- imgsByVol = sd.getVolsOfImage(allVols, imgUUID)
- if all(len(v.imgs) == 1 for k, v in imgsByVol.iteritems()):
- # This is a self contained regular image, i.e. it's either an image
- # which is not based on a template or a template which has no
- # derived images, e.g. not derived from a template
- img.delete(sdUUID=sdUUID, imgUUID=imgUUID, postZero=postZero, force=force)
- else:
- # This is either a template with derived images or a derived image
- # so needs further scrutiny
- ts = tuple((volName, vol.imgs) for volName, vol in
- imgsByVol.iteritems() if len(vol.imgs) > 1)
- if len(ts) != 1:
- raise se.ImageValidationError("Image points to multiple"
- "templates %s in %s from %s" % \
- (ts, imgsByVol, allVols))
- # TODO: Lock the template, reload allVols.
- # template = ts[0] = [(tName, tImgs)]
- tName, tImgs = ts[0]
- # getAllVolumes makes the template self img the 1st one in tImgs
- templateImage = tImgs[0]
- numOfDependentImgs = len(tImgs) - 1
- if templateImage != imgUUID:
- # Removing an image based on a template
- img.delete(sdUUID=sdUUID, imgUUID=imgUUID, postZero=postZero, force=force)
- if numOfDependentImgs == 1 and dom.produceVolume(templateImage, tName).isFake():
- # Remove the fake template since last consumer was removed
- img.delete(sdUUID=sdUUID, imgUUID=templateImage, postZero=False, force=True)
-
- # Removing a template with dependencies
- elif force:
- img.delete(sdUUID=sdUUID, imgUUID=templateImage, postZero=postZero,
- force=force)
- elif not dom.isBackup():
- raise se.ImagesActionError("Can't remove template with children %s",
- allVols)
- else:
- # Removing a template with dependencies in backup domain
- # A fake template will be created
- img.delete(sdUUID=sdUUID, imgUUID=imgUUID, postZero=postZero, force=True)
- tParams = dom.produceVolume(imgUUID, tName).getVolumeParams()
- img.createFakeTemplate(sdUUID=sdUUID, volParams=tParams)
-
def mergeSnapshots(self, sdUUID, vmUUID, imgUUID, ancestor, successor, postZero):
"""
Merges the source volume to the destination volume.
@@ -2012,10 +1945,6 @@
def preDeleteRename(self, sdUUID, imgUUID):
repoPath = os.path.join(self.storage_repository, self.spUUID)
return image.Image(repoPath).preDeleteRename(sdUUID, imgUUID)
-
- def validateDelete(self, sdUUID, imgUUID):
- repoPath = os.path.join(self.storage_repository, self.spUUID)
- image.Image(repoPath).validateDelete(sdUUID, imgUUID)
def validateVolumeChain(self, sdUUID, imgUUID):
repoPath = os.path.join(self.storage_repository, self.spUUID)
--
To view, visit http://gerrit.ovirt.org/8507
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icf01de7dc8bf0a903ebf94d9e33ffad9a195b7de
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
10 years, 11 months
Change in vdsm[master]: packaging: move /rhev/data-center to /var/lib/vdsm/data-cent...
by Alon Bar-Lev
Alon Bar-Lev has uploaded a new change for review.
Change subject: packaging: move /rhev/data-center to /var/lib/vdsm/data-center
......................................................................
packaging: move /rhev/data-center to /var/lib/vdsm/data-center
rhev is a trademark should not be in ovirt.
It is not FHS compliant to add /whatever to filesystem.
Change-Id: I4ed316fedbf2e4d7e5bf741b7c77a39704994ae7
Signed-off-by: Alon Bar-Lev <alonbl(a)redhat.com>
---
M configure.ac
M tests/getAllVolumesTests.py
M vdsm.spec.in
M vdsm/storage/fileSD.py
M vdsm/storage/fileVolume.py
5 files changed, 12 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/8500/1
diff --git a/configure.ac b/configure.ac
index 450f714..665f1c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -75,7 +75,7 @@
AC_SUBST([vdsmexecdir], ['${libexecdir}/vdsm'])
AC_SUBST([vdsmhooksdir], ['${vdsmexecdir}/hooks'])
AC_SUBST([vdsmtsdir], ['${sysconfdir}/pki/vdsm'])
-AC_SUBST([vdsmrepo], ['/rhev/data-center'])
+AC_SUBST([vdsmrepo], ['${vdsmlibdir}/data-center'])
AC_SUBST([vdsmpylibdir], ['${pyexecdir}/vdsm'])
AC_SUBST([vdsmtooldir], ['${vdsmpylibdir}/tool'])
AC_SUBST([vdsmtestsdir], ['${datarootdir}/vdsm/tests'])
diff --git a/tests/getAllVolumesTests.py b/tests/getAllVolumesTests.py
index ffc12c5..fe4c7b9 100644
--- a/tests/getAllVolumesTests.py
+++ b/tests/getAllVolumesTests.py
@@ -62,7 +62,7 @@
Input file name: 'glob_<sdName>.out
Input file format: str(glob.glob(<imgsDir>))
When
- <imgsDir> = /rhev/data-center/mnt/<mntPoint>/<sdName>/images/*.meta
+ <imgsDir> = @vdsmlibdir@/data-center/mnt/<mntPoint>/<sdName>/images/*.meta
"""
sdPath, globExp = volMetaPattern.split('/images')
sdHead, sdName = os.path.split(sdPath)
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 716489a..8e9fbba 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -460,6 +460,14 @@
fi
%post
+# upgrade old locations
+if [ -d /rhev/data-center ]; then
+ mv /rhev/data-center %{_localstatedir}/lib/vdsm/data-center.new && \
+ rm -rf %{_localstatedir}/lib/vdsm/data-center &&
+ mv %{_localstatedir}/lib/vdsm/data-center.new %{_localstatedir}/lib/vdsm/data-center &&
+ rm -rf /rhev
+fi
+
# set the vdsm "secret" password for libvirt
%{_bindir}/vdsm-tool set-saslpasswd
diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py
index 054fadb..bb0f0ba 100644
--- a/vdsm/storage/fileSD.py
+++ b/vdsm/storage/fileSD.py
@@ -64,7 +64,7 @@
def getDomUuidFromMetafilePath(metafile):
# Metafile path has pattern:
- # /rhev/data-center/mnt/export-path/sdUUID/dom_md/metadata
+ # @vdsmlibdir@/data-center/mnt/export-path/sdUUID/dom_md/metadata
metaList = os.path.normpath(metafile).split('/')
return metaList[-3]
diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py
index 0aa9043..08fc8b8 100644
--- a/vdsm/storage/fileVolume.py
+++ b/vdsm/storage/fileVolume.py
@@ -40,7 +40,7 @@
def getDomUuidFromVolumePath(volPath):
# Volume path has pattern:
- # /rhev/data-center/spUUID/sdUUID/images/imgUUID/volUUID
+ # @vdsmlibdir@/data-center/spUUID/sdUUID/images/imgUUID/volUUID
# sdUUID position after data-center
sdUUIDPos = 3
--
To view, visit http://gerrit.ovirt.org/8500
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4ed316fedbf2e4d7e5bf741b7c77a39704994ae7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <alonbl(a)redhat.com>
10 years, 12 months
Change in vdsm[master]: build: use architecture independent location of site-package...
by Alon Bar-Lev
Alon Bar-Lev has uploaded a new change for review.
Change subject: build: use architecture independent location of site-packages if possible
......................................................................
build: use architecture independent location of site-packages if possible
Currently all vdsm python modules go into pyexecdir, which is the
architecture specific location.
Python architecture independent modules should go into pythondir.
In x86_64 system locations are:
pythondir = /usr/lib/python2.7/site-packages
pyexecdir = /usr/lib64/python2.7/site-packages
Both are in default search path of python:
---
print(sys.path)"
['', '/root', '/usr/lib64/python27.zip', '/usr/lib64/python2.7',
'/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk',
'/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload',
'/usr/lib64/python2.7/site-packages',
'/usr/lib64/python2.7/site-packages/gst-0.10',
'/usr/lib64/python2.7/site-packages/gtk-2.0',
'/usr/lib/python2.7/site-packages',
'/usr/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info']
---
In vdsm project only the betterPopen package is architecture specific,
it should go into pyexecdir while all other packages should go into
pythondir.
Change-Id: I975cab5c885697d3c43d083e243f8004587fd2bc
Signed-off-by: Alon Bar-Lev <alonbl(a)redhat.com>
---
M configure.ac
M vdsm/betterPopen/Makefile.am
2 files changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/98/6098/1
--
To view, visit http://gerrit.ovirt.org/6098
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I975cab5c885697d3c43d083e243f8004587fd2bc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <alonbl(a)redhat.com>
10 years, 12 months
Change in vdsm[master]: vdsmd: remove bashisms found with checkbashism script on ubu...
by Ryan Harper
Ryan Harper has uploaded a new change for review.
Change subject: vdsmd: remove bashisms found with checkbashism script on ubuntu
......................................................................
vdsmd: remove bashisms found with checkbashism script on ubuntu
Ubuntu uses dash for its /bin/sh and some of the shell scripting
includes bashisms that come through even with bash --posix (aka
/bin/sh -> /bin/bash.
Most of the fixes fall into the following changes:
- Using '=' instead of '==' for comparison
- Using '[ ]' instead of '[[ ]]' for test
- replacing {..} with seq
The remaining bashisms are around emitting messages, updating these
would require moving to using gettext's shell helper for producing
intl. lang equivalents.
To find files in the repository that need scanning, I looked for files
with '/bin/sh' in the file, excluding non-shell script files. For each
of the files that filtered through, I ran checkbashisms to see if the
file needed a closer look.
% find . -type f | egrep -v "(configure|build|aclocal|.py|Makefile|README|.git|autom4te.cache)" | xargs -i grep -l "/bin/sh" {}
./scripts/make_device_config.sh
./scripts/create_config
./scripts/feature_to_c.sh
./scripts/hxtool
./scripts/signrom.sh
./scripts/tracetool
./scripts/qemu-binfmt-conf.sh
./scripts/update-linux-headers.sh
./scripts/check-qerror.sh
./vdsm/sudoers.vdsm.in
./vdsm/vdsm-logrotate
./vdsm/vdsmd.init.in
./autogen.sh
./vdsm_cli/vdsClient.in
./tests/run_tests.sh.in
./tests/run_tests_local.sh.in
./vdsm_reg/vdsm-reg-logrotate
(platechiller) vdsm % find . -type f | egrep -v "(configure|build|aclocal|.py|Makefile|README|.git|autom4te.cache)" | xargs -i grep -l "/bin/sh" {} | xargs -i bash -c 'P={}; checkbashisms $P &>/dev/null || echo $P'
./vdsm/vdsmd.init.in
Only vdsmd.init.in needed fixing.
Change-Id: Iece592e9cc3dfa361c99812461d783bff7f780a0
Signed-off-by: Ryan Harper <ryanh(a)us.ibm.com>
---
M vdsm/vdsmd.init.in
1 file changed, 11 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/36/8336/1
diff --git a/vdsm/vdsmd.init.in b/vdsm/vdsmd.init.in
index 0012157..2c0e894 100755
--- a/vdsm/vdsmd.init.in
+++ b/vdsm/vdsmd.init.in
@@ -112,13 +112,13 @@
local listen_tcp auth_tcp ssl
ssl=`$GETCONFITEM $CONF_FILE vars ssl true | tr A-Z a-z`
- [ "$ssl" == true ] && return 0
+ [ "$ssl" = "true" ] && return 0
listen_tcp="`get_libvirt_conf_item $LCONF listen_tcp`"
auth_tcp="`get_libvirt_conf_item $LCONF auth_tcp`"
spice_tls="`get_libvirt_conf_item $QCONF spice_tls`"
- if [ "$listen_tcp" == 1 -a "$auth_tcp" == '"none"' -a "$spice_tls" == 0 ];
+ if [ "$listen_tcp" = "1" -a "$auth_tcp" = '"none"' -a "$spice_tls" = "0" ];
then
return 0
else
@@ -138,7 +138,7 @@
/sbin/chkconfig $srv off
if /sbin/service $srv status > /dev/null 2>&1;
then
- if [ "$srv" == "libvirt-guests" ]; then
+ if [ "$srv" = "libvirt-guests" ]; then
/bin/rm -f /var/lock/subsys/libvirt-guests
else
/sbin/service $srv stop
@@ -149,7 +149,7 @@
}
libvirt_should_use_upstart() {
- [[ -x /sbin/initctl ]]
+ [ -x /sbin/initctl ]
}
start_needed_srv() {
@@ -297,7 +297,7 @@
set_if_default $lconf host_uuid \"$(uuidgen)\"
set_if_default $qconf dynamic_ownership 0
- if [[ "$ssl" == true ]]; then
+ if [ "$ssl" = "true" ]; then
set_if_default $qconf spice_tls 1
else
set_if_default $qconf spice_tls 0
@@ -314,7 +314,7 @@
if [ -f $ts/certs/cacert.pem -a \
-f $ts/certs/vdsmcert.pem -a \
-f $ts/keys/vdsmkey.pem -a \
- "$ssl" == true ];
+ "$ssl" = "true" ];
then
set_if_default $lconf ca_file \"$ts/certs/cacert.pem\"
set_if_default $lconf cert_file \"$ts/certs/vdsmcert.pem\"
@@ -389,7 +389,7 @@
stop_libvirtd_sysv() {
# stop libvirt SysV service if we intend to configure upstart
- if libvirt_should_use_upstart && ! [[ -f /etc/init/libvirtd.conf ]]; then
+ if libvirt_should_use_upstart && ! [ -f /etc/init/libvirtd.conf ]; then
/sbin/chkconfig libvirtd off
/sbin/service libvirtd stop
fi
@@ -400,7 +400,7 @@
# its socket is not yet ready. Once issue fixed on libvirt,
# this workaround should be removed.
- for i in {1..50}
+ for i in $(seq 1 50)
do
if /usr/bin/virsh -r version > /dev/null 2>&1; then
return 0
@@ -426,14 +426,14 @@
/bin/grep libvirtd.upstart | /usr/bin/tail -1`
target=/etc/init/libvirtd.conf
- if [[ -f "$packaged" ]] && ! diff -q "$packaged" "$target" >/dev/null;
+ if [ -f "$packaged" ] && ! diff -q "$packaged" "$target" >/dev/null;
then
/bin/cp -p "$packaged" "$target" || return 1
/sbin/initctl reload-configuration
fi
startout=`/sbin/initctl start libvirtd 2>&1`
- if [[ "$?" -eq 0 || "$startout" =~ .*already\ running.* ]];
+ if [ "$?" -eq 0 || "$startout" =~ .*already\ running.* ];
then
await_libvirt_start_workaround
return 0
@@ -480,7 +480,7 @@
mk_dom_backup
mk_run_path
/bin/chmod 1777 /dev/shm
- if [ $is_coredump == true ]; then
+ if [ $is_coredump = "true" ]; then
export DAEMON_COREFILE_LIMIT=unlimited
echo $CORE_DUMP_PATH > $CORE_PATTERN
fi
--
To view, visit http://gerrit.ovirt.org/8336
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iece592e9cc3dfa361c99812461d783bff7f780a0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ryan Harper <ryanh(a)us.ibm.com>
11 years
Change in vdsm[master]: SUDO change, move fuser call to super vdsm
by xiawenc@linux.vnet.ibm.com
Wenchao Xia has uploaded a new change for review.
Change subject: SUDO change, move fuser call to super vdsm
......................................................................
SUDO change, move fuser call to super vdsm
supervdsm.fuser() will return out result from executing, and
fuser.py will parse it.
Change-Id: I0bb881e6bcad213db1d186e70f41b22d78ee3ecf
Signed-off-by: wenchao xia <xiawenc(a)linux.vnet.ibm.com>
---
M vdsm/storage/fuser.py
M vdsm/supervdsmServer.py
2 files changed, 20 insertions(+), 13 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/14/5314/1
--
To view, visit http://gerrit.ovirt.org/5314
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0bb881e6bcad213db1d186e70f41b22d78ee3ecf
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Wenchao Xia <xiawenc(a)linux.vnet.ibm.com>
11 years
Change in vdsm[master]: Fix 2nd order exception msg in lvm._initpvs().
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: Fix 2nd order exception msg in lvm._initpvs().
......................................................................
Fix 2nd order exception msg in lvm._initpvs().
Change-Id: I48766ec89b53230974048c9c8144926d1c24a82d
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/lvm.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/19/5319/1
--
To view, visit http://gerrit.ovirt.org/5319
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I48766ec89b53230974048c9c8144926d1c24a82d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
11 years
Change in vdsm[master]: CannotRemoveLogicalVolume is raised with arguments.
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: CannotRemoveLogicalVolume is raised with arguments.
......................................................................
CannotRemoveLogicalVolume is raised with arguments.
Change-Id: Ied29c1dddf4e9d6cf890cb66d362acf9eed99ba6
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/lvm.py
M vdsm/storage/storage_exception.py
2 files changed, 7 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/8808/1
diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
index 78c846a..88d818b 100644
--- a/vdsm/storage/lvm.py
+++ b/vdsm/storage/lvm.py
@@ -1015,7 +1015,7 @@
if _isLVActive(vgName, lvName):
#Fix me
#Should not remove active LVs
- #raise se.CannotRemoveLogicalVolume(vgName, lvName)
+ #raise se.CannotRemoveLogicalVolume(vgName, (lvName,))
log.warning("Removing active volume %s/%s" % (vgName, lvName))
#LV exists or not in cache, attempting to remove it.
@@ -1036,7 +1036,7 @@
else:
# Otherwise LV info needs to be refreshed
_lvminfo._invalidatelvs(vgName, lvName)
- raise se.CannotRemoveLogicalVolume(vgName, str(lvNames))
+ raise se.CannotRemoveLogicalVolume(vgName, lvNames)
def extendLV(vgName, lvName, size):
diff --git a/vdsm/storage/storage_exception.py b/vdsm/storage/storage_exception.py
index 54e64e6..b5f63da 100644
--- a/vdsm/storage/storage_exception.py
+++ b/vdsm/storage/storage_exception.py
@@ -1305,8 +1305,12 @@
class CannotRemoveLogicalVolume(StorageException):
+ def __init__(self, vgName, lvNames):
+ self.value("vg: %s lvs: %s", vgName, ", ".join(lvNames))
+ self.vg = vgName
+ self.lvs = lvNames
code = 551
- message = "Cannot remove Logical Volume"
+ message = "Failed to remove some LVs."
class CannotDeactivateLogicalVolume(StorageException):
--
To view, visit http://gerrit.ovirt.org/8808
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ied29c1dddf4e9d6cf890cb66d362acf9eed99ba6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
11 years, 1 month
Change in vdsm[master]: 2 of 2 Add network logs for VDSM network commands and file o...
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: 2 of 2 Add network logs for VDSM network commands and file operations.
......................................................................
2 of 2 Add network logs for VDSM network commands and file operations.
Second patch in the series that creates a module-specific logger and uses it
with the utility makeExecCmd to increase the detail level of the debugging
information provided by the two modules when calling processes and modifying
files.
Bug-Id: https://bugzilla.redhat.com/851839
Change-Id: Iea3738f5ce66d2537c078c452def30fb3feb5390
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M vdsm/configNetwork.py
M vdsm/tc.py
2 files changed, 38 insertions(+), 30 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/30/7730/1
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index 74d19c7..ceb846d 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -17,7 +17,7 @@
# Refer to the README and COPYING files for full details of the license
#
-import sys, subprocess, os, re, traceback
+import sys, os, re, traceback
import pipes
import pwd
import time
@@ -32,6 +32,7 @@
from vdsm import constants
from vdsm import utils
+from storage.misc import enableLogSkip
import neterrors as ne
from vdsm import define
from vdsm import netinfo
@@ -42,6 +43,11 @@
MAX_BRIDGE_NAME_LEN = 15
ILLEGAL_BRIDGE_CHARS = frozenset(':. \t')
+configNetworkLogger = enableLogSkip(
+ logging.getLogger('configNetwork'), ignoreSourceFiles=[__file__],
+ logSkipName='configNetwork')
+execCmd = utils.makeExecCmd(log=configNetworkLogger)
+
class ConfigNetworkError(Exception):
def __init__(self, errCode, message):
self.errCode = errCode
@@ -50,25 +56,22 @@
def ifdown(iface):
"Bring down an interface"
- p = subprocess.Popen([constants.EXT_IFDOWN, iface], stdout=subprocess.PIPE,
- stderr=subprocess.PIPE, close_fds=True)
- out, err = p.communicate()
+ rc, out, err = execCmd([constants.EXT_IFDOWN, iface], raw=True)
if out.strip():
logging.info(out)
if err.strip():
logging.warn('\n'.join([line for line in err.splitlines()
if not line.endswith(' does not exist!')]))
- return p.returncode
+ return rc
def ifup(iface):
"Bring up an interface"
- p = subprocess.Popen([constants.EXT_IFUP, iface], stdout=subprocess.PIPE,
- stderr=subprocess.PIPE, close_fds=True)
- out, err = p.communicate()
+ rc, out, err = execCmd([constants.EXT_IFUP, iface], raw=True)
if out.strip():
logging.info(out)
if err.strip():
logging.warn(err)
+ return rc
def ifaceUsers(iface):
"Returns a list of entities using the interface"
@@ -157,8 +160,9 @@
mounts = open('/proc/mounts').read()
if ' /config ext3' in mounts and ' %s ext3' % filename in mounts:
- subprocess.call([constants.EXT_UMOUNT, '-n', filename])
+ execCmd([constants.EXT_UMOUNT, '-n', filename])
utils.rmFile(filename)
+ configNetworkLogger.debug("Removed file %s", filename)
def _createNetwork(self, netXml):
conn = libvirtconnection.get()
@@ -291,6 +295,8 @@
for confFile, content in self._backups.iteritems():
if content is None:
utils.rmFile(confFile)
+ configNetworkLogger.debug(
+ 'Removing empty configuration backup %s', confFile)
else:
open(confFile, 'w').write(content)
logging.info('Restored %s', confFile)
@@ -299,9 +305,9 @@
def _persistentBackup(cls, filename):
""" Persistently backup ifcfg-* config files """
if os.path.exists('/usr/libexec/ovirt-functions'):
- subprocess.call([constants.EXT_SH, '/usr/libexec/ovirt-functions',
+ execCmd([constants.EXT_SH, '/usr/libexec/ovirt-functions',
'unmount_config', filename])
- logging.debug("unmounted %s using ovirt", filename)
+ configNetworkLogger.debug("unmounted %s using ovirt", filename)
(dummy, basename) = os.path.split(filename)
if os.path.exists(filename):
@@ -309,7 +315,7 @@
else:
# For non-exists ifcfg-* file use predefined header
content = cls.DELETED_HEADER + '\n'
- logging.debug("backing up %s: %s", basename, content)
+ configNetworkLogger.debug("backing up %s: %s", basename, content)
cls.writeBackupFile(netinfo.NET_CONF_BACK_DIR, basename, content)
@@ -349,16 +355,12 @@
if not self._backups and not self._networksBackups:
return
- subprocess.Popen(['/etc/init.d/network', 'stop'],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE).communicate()
+ execCmd(['/etc/init.d/network', 'stop'])
self.restoreAtomicNetworkBackup()
self.restoreAtomicBackup()
- subprocess.Popen(['/etc/init.d/network', 'start'],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE).communicate()
+ execCmd(['/etc/init.d/network', 'start'])
@classmethod
def clearBackups(cls):
@@ -374,8 +376,8 @@
try:
selinux.restorecon(fileName)
except:
- logging.debug('ignoring restorecon error in case SElinux is '
- 'disabled', exc_info=True)
+ configNetworkLogger.debug('ignoring restorecon error in case '
+ 'SElinux is disabled', exc_info=True)
def _createConfFile(self, conf, name, ipaddr=None, netmask=None,
gateway=None, bootproto=None, mtu=None, onboot='yes', **kwargs):
@@ -405,7 +407,7 @@
if re.match('^[a-zA-Z_]\w*$', k):
cfg += '%s=%s\n' % (k.upper(), pipes.quote(kwargs[k]))
else:
- logging.debug('ignoring variable %s', k)
+ configNetworkLogger.debug('ignoring variable %s', k)
self.writeConfFile(self.NET_CONF_PREF + name, cfg)
@@ -499,8 +501,7 @@
def removeVlan(self, vlan, iface):
vlandev = iface + '.' + vlan
ifdown(vlandev)
- subprocess.call([constants.EXT_IPROUTE, 'link', 'del', vlandev],
- stderr=subprocess.PIPE)
+ execCmd([constants.EXT_IPROUTE, 'link', 'del', vlandev])
self._backup(self.NET_CONF_PREF + iface + '.' + vlan)
self._removeFile(self.NET_CONF_PREF + iface + '.' + vlan)
@@ -510,7 +511,7 @@
def removeBridge(self, bridge):
ifdown(bridge)
- subprocess.call([constants.EXT_BRCTL, 'delbr', bridge])
+ execCmd([constants.EXT_BRCTL, 'delbr', bridge])
self._backup(self.NET_CONF_PREF + bridge)
self._removeFile(self.NET_CONF_PREF + bridge)
@@ -829,7 +830,7 @@
# Validation
if not utils.tobool(force):
- logging.debug('validating network...')
+ configNetworkLogger.debug('validating network...')
_addNetworkValidation(_netinfo, network=network,
vlan=vlan, bonding=bonding, nics=nics, ipaddr=ipaddr,
netmask=netmask, gateway=gateway, bondingOptions=bondingOptions,
@@ -1125,8 +1126,8 @@
_netinfo = netinfo.NetInfo()
for bond, bondAttrs in bondings.iteritems():
- logger.debug("Creating/Editing bond %s with attributes %s",
- bond, bondAttrs)
+ logger.debug("Creating/Editing bond %s with attributes %s", bond,
+ bondAttrs)
brNets = list(_netinfo.getBridgedNetworksForIface(bond))
# Only one bridged-non-VLANed network allowed on same nic/bond
@@ -1315,7 +1316,7 @@
def setSafeNetworkConfig():
"""Declare current network configuration as 'safe'"""
- subprocess.Popen([constants.EXT_VDSM_STORE_NET_CONFIG])
+ execCmd([constants.EXT_VDSM_STORE_NET_CONFIG])
def usage():
print """Usage:
diff --git a/vdsm/tc.py b/vdsm/tc.py
index a0a612f..44c5bb1 100644
--- a/vdsm/tc.py
+++ b/vdsm/tc.py
@@ -18,16 +18,23 @@
# Refer to the README and COPYING files for full details of the license
#
+import logging
from collections import namedtuple
import ethtool
-import storage.misc
+import utils
+from storage.misc import enableLogSkip
from vdsm.constants import EXT_TC, EXT_IFCONFIG
ERR_DEV_NOEXIST = 2
QDISC_INGRESS = 'ffff:'
+
+tcLogger = enableLogSkip(
+ logging.getLogger('trafficControl'), ignoreSourceFiles=[__file__],
+ logSkipName='trafficControl')
+execCmd = utils.makeExecCmd(log=tcLogger)
class TrafficControlException(Exception):
@@ -95,7 +102,7 @@
def _process_request(command):
- retcode, out, err = storage.misc.execCmd(command, raw=True, sudo=False)
+ retcode, out, err = execCmd(command, raw=True, sudo=False)
if retcode != 0:
raise TrafficControlException(retcode, err, command)
return out
--
To view, visit http://gerrit.ovirt.org/7730
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iea3738f5ce66d2537c078c452def30fb3feb5390
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
11 years, 1 month
Change in vdsm[master]: Fix mbx Exception type.
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: Fix mbx Exception type.
......................................................................
Fix mbx Exception type.
Change-Id: Id8baf1121aaf351b029945972d5e87dbfa6a0bd5
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/storage_mailbox.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/17/6617/1
--
To view, visit http://gerrit.ovirt.org/6617
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id8baf1121aaf351b029945972d5e87dbfa6a0bd5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
11 years, 2 months