Federico Simoncelli has uploaded a new change for review. Change subject: lib: rename qemuImg to qemuimg for pep8 compliancy ......................................................................
lib: rename qemuImg to qemuimg for pep8 compliancy Modules should have short, all-lowercase names. Change-Id: I4fad13d1b9b44f93b5fd0532e4d3ed6b55170eb5 Signed-off-by: Federico Simoncelli <[email protected]> --- M debian/vdsm-python.install M lib/vdsm/Makefile.am R lib/vdsm/qemuimg.py M vdsm.spec.in M vdsm/storage/blockVolume.py M vdsm/storage/hsm.py M vdsm/storage/image.py M vdsm/storage/imageRepository/formatConverter.py M vdsm/storage/volume.py M vdsm/virt/vm.py 10 files changed, 25 insertions(+), 25 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/66/26866/1 diff --git a/debian/vdsm-python.install b/debian/vdsm-python.install index 135860f..df873c6 100644 --- a/debian/vdsm-python.install +++ b/debian/vdsm-python.install @@ -12,7 +12,7 @@ ./usr/lib/python2.7/dist-packages/vdsm/netconfpersistence.py ./usr/lib/python2.7/dist-packages/vdsm/netinfo.py ./usr/lib/python2.7/dist-packages/vdsm/netlink.py -./usr/lib/python2.7/dist-packages/vdsm/qemuImg.py +./usr/lib/python2.7/dist-packages/vdsm/qemuimg.py ./usr/lib/python2.7/dist-packages/vdsm/tool/__init__.py ./usr/lib/python2.7/dist-packages/vdsm/tool/dummybr.py ./usr/lib/python2.7/dist-packages/vdsm/tool/configurator.py diff --git a/lib/vdsm/Makefile.am b/lib/vdsm/Makefile.am index 223edc7..a73af87 100644 --- a/lib/vdsm/Makefile.am +++ b/lib/vdsm/Makefile.am @@ -31,7 +31,7 @@ netconfpersistence.py \ netinfo.py \ netlink.py \ - qemuImg.py \ + qemuimg.py \ SecureXMLRPCServer.py \ utils.py \ $(NULL) diff --git a/lib/vdsm/qemuImg.py b/lib/vdsm/qemuimg.py similarity index 100% rename from lib/vdsm/qemuImg.py rename to lib/vdsm/qemuimg.py diff --git a/vdsm.spec.in b/vdsm.spec.in index 08fc15e..1e8b789 100644 --- a/vdsm.spec.in +++ b/vdsm.spec.in @@ -1135,7 +1135,7 @@ %{python_sitearch}/%{vdsm_name}/libvirtconnection.py* %{python_sitearch}/%{vdsm_name}/netinfo.py* %{python_sitearch}/%{vdsm_name}/netlink.py* -%{python_sitearch}/%{vdsm_name}/qemuImg.py* +%{python_sitearch}/%{vdsm_name}/qemuimg.py* %{python_sitearch}/%{vdsm_name}/SecureXMLRPCServer.py* %{python_sitearch}/%{vdsm_name}/netconfpersistence.py* %{python_sitearch}/%{vdsm_name}/utils.py* diff --git a/vdsm/storage/blockVolume.py b/vdsm/storage/blockVolume.py index 65be640..b8e59ec 100644 --- a/vdsm/storage/blockVolume.py +++ b/vdsm/storage/blockVolume.py @@ -23,7 +23,7 @@ import logging import sanlock -from vdsm import qemuImg +from vdsm import qemuimg from vdsm import constants from vdsm.config import config import vdsm.utils as utils @@ -291,8 +291,8 @@ if volParams['volFormat'] == volume.COW_FORMAT: self.prepare(justme=True) try: - check = qemuImg.check(self.getVolumePath(), - qemuImg.FORMAT.QCOW2) + check = qemuimg.check(self.getVolumePath(), + qemuimg.FORMAT.QCOW2) finally: self.teardown(self.sdUUID, self.volUUID, justme=True) volActualSize = check['offset'] diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py index 9040d79..04fdce7 100644 --- a/vdsm/storage/hsm.py +++ b/vdsm/storage/hsm.py @@ -75,7 +75,7 @@ import supervdsm import storageServer from vdsm import utils -from vdsm import qemuImg +from vdsm import qemuimg GUID = "guid" NAME = "name" @@ -704,7 +704,7 @@ volToExtend.prepare() try: - imgInfo = qemuImg.info(volPath, qemuImgFormat) + imgInfo = qemuimg.info(volPath, qemuImgFormat) if imgInfo['virtualsize'] > newSizeBytes: self.log.error( "volume %s size %s is larger than the size requested " @@ -713,8 +713,8 @@ raise se.VolumeResizeValueError(str(newSizeBytes)) # Uncommit the current size volToExtend.setSize(0) - qemuImg.resize(volPath, newSizeBytes, qemuImgFormat) - roundedSizeBytes = qemuImg.info(volPath, + qemuimg.resize(volPath, newSizeBytes, qemuImgFormat) + roundedSizeBytes = qemuimg.info(volPath, qemuImgFormat)['virtualsize'] finally: volToExtend.teardown(sdUUID, volUUID) diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py index 795156d..4de9e2c 100644 --- a/vdsm/storage/image.py +++ b/vdsm/storage/image.py @@ -25,7 +25,7 @@ from contextlib import contextmanager import volume -from vdsm import qemuImg +from vdsm import qemuimg from sdc import sdCache import sd import misc @@ -424,7 +424,7 @@ srcFmtStr = volume.fmt2str(srcFmt) dstFmtStr = volume.fmt2str(dstVol.getFormat()) self.log.debug("start qemu convert") - qemuImg.convert(srcVol.getVolumePath(), + qemuimg.convert(srcVol.getVolumePath(), dstVol.getVolumePath(), vars.task.aborting, srcFmtStr, dstFmtStr) @@ -1137,7 +1137,7 @@ volUUID=srcVolParams['volUUID']) try: newVol.shrinkToOptimalSize() - except qemuImg.QImgError: + except qemuimg.QImgError: self.log.warning("Auto shrink after merge failed", exc_info=True) self.log.info("Merge src=%s with dst=%s was successfully finished.", diff --git a/vdsm/storage/imageRepository/formatConverter.py b/vdsm/storage/imageRepository/formatConverter.py index c701163..0c80a6d 100644 --- a/vdsm/storage/imageRepository/formatConverter.py +++ b/vdsm/storage/imageRepository/formatConverter.py @@ -21,7 +21,7 @@ import logging from vdsm import constants -from vdsm import qemuImg +from vdsm import qemuimg from storage import sd from storage import blockSD @@ -134,8 +134,8 @@ metaVolSize = int(vol.getMetaParam(volume.SIZE)) if vol.getFormat() == volume.COW_FORMAT: - qemuVolInfo = qemuImg.info(vol.getVolumePath(), - qemuImg.FORMAT.QCOW2) + qemuVolInfo = qemuimg.info(vol.getVolumePath(), + qemuimg.FORMAT.QCOW2) virtVolSize = qemuVolInfo["virtualsize"] / V2META_SECTORSIZE else: virtVolSize = vol.getVolumeSize() @@ -278,7 +278,7 @@ try: vol = domain.produceVolume(imgUUID, volUUID) v3ResetMetaVolSize(vol) # BZ#811880 - except qemuImg.QImgError: + except qemuimg.QImgError: log.error("It is not possible to read the volume %s " "using qemu-img, the content looks damaged", volUUID, exc_info=True) diff --git a/vdsm/storage/volume.py b/vdsm/storage/volume.py index 65a0bae..14deddc 100644 --- a/vdsm/storage/volume.py +++ b/vdsm/storage/volume.py @@ -27,7 +27,7 @@ import image from vdsm import constants from vdsm import utils -from vdsm import qemuImg +from vdsm import qemuimg import storage_exception as se import sd from sdc import sdCache @@ -704,7 +704,7 @@ # Going directly to the metadata parameter as we should skip the size # validation in getSize. if int(self.getMetaParam(SIZE)) < 1: - volInfo = qemuImg.info( + volInfo = qemuimg.info( self.getVolumePath(), fmt2str(self.getFormat())) # qemu/qemu-img rounds down self.setSize(volInfo['virtualsize'] / BLOCK_SIZE) diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py index 6711bc6..e7f6ddf 100644 --- a/vdsm/virt/vm.py +++ b/vdsm/virt/vm.py @@ -38,7 +38,7 @@ from vdsm import constants from vdsm import libvirtconnection from vdsm import netinfo -from vdsm import qemuImg +from vdsm import qemuimg from vdsm import utils from vdsm.compat import pickle from vdsm.config import config @@ -3178,8 +3178,8 @@ # FIXME: This should be replaced in future the support for transient # disk in libvirt (BZ#832194) driveFormat = ( - qemuImg.FORMAT.QCOW2 if diskParams['format'] == 'cow' else - qemuImg.FORMAT.RAW + qemuimg.FORMAT.QCOW2 if diskParams['format'] == 'cow' else + qemuimg.FORMAT.RAW ) transientHandle, transientPath = tempfile.mkstemp( @@ -3187,7 +3187,7 @@ prefix="%s-%s." % (diskParams['domainID'], diskParams['volumeID'])) try: - qemuImg.create(transientPath, format=qemuImg.FORMAT.QCOW2, + qemuimg.create(transientPath, format=qemuimg.FORMAT.QCOW2, backing=diskParams['path'], backingFormat=driveFormat) os.fchmod(transientHandle, 0o660) @@ -3997,7 +3997,7 @@ # Patches have been submitted to avoid this behavior, the virtual # and apparent sizes will be returned by the qemu process and # through the libvirt blockInfo call. - currentSize = qemuImg.info(drive.path, "qcow2")['virtualsize'] + currentSize = qemuimg.info(drive.path, "qcow2")['virtualsize'] if currentSize > newSizeBytes: self.log.error( @@ -4021,7 +4021,7 @@ finally: # In all cases we want to try and fix the size in the metadata. # Same as above, this is what libvirt would do, see BZ#963881 - sizeRoundedBytes = qemuImg.info(drive.path, "qcow2")['virtualsize'] + sizeRoundedBytes = qemuimg.info(drive.path, "qcow2")['virtualsize'] self.cif.irs.setVolumeSize( drive.domainID, drive.poolID, drive.imageID, drive.volumeID, sizeRoundedBytes) -- To view, visit http://gerrit.ovirt.org/26866 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4fad13d1b9b44f93b5fd0532e4d3ed6b55170eb5 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
