Change in vdsm[master]: tests: Fix FakeLVM lv creation size

nsoffer at redhat.com nsoffer at redhat.com
Sat Apr 9 18:54:38 UTC 2016


Nir Soffer has posted comments on this change.

Change subject: tests: Fix FakeLVM lv creation size
......................................................................


Patch Set 1: Code-Review-1

(3 comments)

https://gerrit.ovirt.org/#/c/55888/1/tests/storagetestlib.py
File tests/storagetestlib.py:

Line 28: 
Line 29: 
Line 30: NR_PVS = 2       # The number of fake PVs we use to make a fake VG by default
Line 31: MDSIZE = 524288  # The size (in bytes) of fake metadata files
Line 32: MB = 1048576     # Used to convert bytes to MB
:-)

I would use the more clear 1024 * 1024 or 1024**2
Line 33: 
Line 34: 
Line 35: class FakeEnv(object):
Line 36:     def __init__(self, sd_manifest, lvm=None):


Line 156:     sduuid = sd_manifest.sdUUID
Line 157:     image_manifest = image.ImageManifest(sd_manifest.getRepoPath())
Line 158:     imagedir = image_manifest.getImageDir(sduuid, imguuid)
Line 159:     os.makedirs(imagedir)
Line 160:     size_mb = (size + MB - 1) / MB
Use utils.round
Line 161:     lvm.createLV(sduuid, voluuid, size_mb)
Line 162:     with sd_manifest.acquireVolumeMetadataSlot(
Line 163:             voluuid, blockVolume.VOLUME_MDNUMBLKS) as slot:
Line 164:         lvm.addtag(sduuid, voluuid, "%s%s" % (blockVolume.TAG_PREFIX_MD, slot))


Line 172:         (sduuid, slot),
Line 173:         sduuid,
Line 174:         imguuid,
Line 175:         parent_vol_id,
Line 176:         size_mb * MB / volume.BLOCK_SIZE,
Lets make this more clear by adding an explaining variable:

    size_blk = size_mb * MB / volume.BLOCK_SIZE

and use this variable in the call.
Line 177:         volume.type2name(vol_format),
Line 178:         volume.type2name(prealloc),
Line 179:         volume.type2name(volume.LEAF_VOL),
Line 180:         disk_type,


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I975b35d4e386e23e3b58ede6314939f1ad293619
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list