Liron Ar has uploaded a new change for review.
Change subject: volume: move metadata dict creation to volume.py ......................................................................
volume: move metadata dict creation to volume.py
Change-Id: I26c495d437fe327a4029fe1dae087d182ba6611b Signed-off-by: Liron Aravot laravot@redhat.com --- M vdsm/storage/blockVolume.py M vdsm/storage/fileVolume.py M vdsm/storage/volume.py 3 files changed, 16 insertions(+), 19 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/92/28492/1
diff --git a/vdsm/storage/blockVolume.py b/vdsm/storage/blockVolume.py index 81331fa..d448e00 100644 --- a/vdsm/storage/blockVolume.py +++ b/vdsm/storage/blockVolume.py @@ -574,20 +574,12 @@ try: meta = misc.readblock(lvm.lvPath(vgname, sd.METADATA), offs * VOLUME_METASIZE, VOLUME_METASIZE) - out = {} - for l in meta: - if l.startswith("EOF"): - return out - if l.find("=") < 0: - continue - key, value = l.split("=") - out[key.strip()] = value.strip() + return self.metadata2dict(meta)
except Exception as e: self.log.error(e, exc_info=True) raise se.VolumeMetadataReadError("%s: %s" % (metaId, e))
- return out
def setMetadata(self, meta, metaId=None): """ diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py index 654818e..6b655b8 100644 --- a/vdsm/storage/fileVolume.py +++ b/vdsm/storage/fileVolume.py @@ -294,20 +294,11 @@
try: f = self.oop.directReadLines(metaPath) - out = {} - for l in f: - if l.startswith("EOF"): - return out - if l.find("=") < 0: - continue - key, value = l.split("=") - out[key.strip()] = value.strip() + return self.metadata2dict(f)
except Exception as e: self.log.error(e, exc_info=True) raise se.VolumeMetadataReadError("%s: %s" % (metaId, e)) - - return out
@classmethod def __putMetadata(cls, metaId, meta): diff --git a/vdsm/storage/volume.py b/vdsm/storage/volume.py index 3a5ed8e..aed932e 100644 --- a/vdsm/storage/volume.py +++ b/vdsm/storage/volume.py @@ -814,6 +814,20 @@ """ pass
+ + def metadata2dict(self, meta): + out = {} + for l in meta: + if l.startswith("EOF"): + return out + if l.find("=") < 0: + continue + key, value = l.split("=") + out[key.strip()] = value.strip() + + return out + + def metadata2info(self, meta): return { "uuid": self.volUUID,
oVirt Jenkins CI Server has posted comments on this change.
Change subject: volume: move metadata dict creation to volume.py ......................................................................
Patch Set 1: Code-Review-1 Verified-1
Build Unstable
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit/9810/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/8872/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/9657/ : UNSTABLE
http://jenkins.ovirt.org/job/vdsm_master_storage_functional_tests_localfs_ge... : SUCCESS
oVirt Jenkins CI Server has posted comments on this change.
Change subject: volume: move metadata dict creation to volume.py ......................................................................
Patch Set 2: Code-Review-1 Verified-1
Build Failed
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/8874/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/9659/ : UNSTABLE
http://jenkins.ovirt.org/job/vdsm_master_storage_functional_tests_localfs_ge... : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit/9813/ : FAILURE
oVirt Jenkins CI Server has posted comments on this change.
Change subject: volume: move metadata dict creation to volume.py ......................................................................
Patch Set 3:
Build Successful
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/8883/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/9667/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_storage_functional_tests_localfs_ge... : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit/9822/ : SUCCESS
Nir Soffer has posted comments on this change.
Change subject: volume: move metadata dict creation to volume.py ......................................................................
Patch Set 3:
(1 comment)
http://gerrit.ovirt.org/#/c/28492/3/vdsm/storage/volume.py File vdsm/storage/volume.py:
Line 812: Teardown volume. Line 813: If justme is false, the entire COW chain is teared down. Line 814: """ Line 815: pass Line 816: This module uses mixedCase, so this function should be named parseMetadata. metadata2dict is consistent with metadata2info, but the later is not consistent with the rest of the module naming conventions. I don't like this style but consistency is important.
In another patch we should also remove the duplicate code writing the meta data in blockVolume.py and fileVolume.py and move it to formatMetadata function in this module. Line 817: def metadata2dict(self, meta): Line 818: out = {} Line 819: for l in meta: Line 820: if l.startswith("EOF"):
Itamar Heim has posted comments on this change.
Change subject: volume: move metadata dict creation to volume.py ......................................................................
Patch Set 3:
ping
Jenkins CI RO has posted comments on this change.
Change subject: volume: move metadata dict creation to volume.py ......................................................................
Patch Set 3:
Abandoned due to no activity - please restore if still relevant
Jenkins CI RO has abandoned this change.
Change subject: volume: move metadata dict creation to volume.py ......................................................................
Abandoned
Abandoned due to no activity - please restore if still relevant
automation@ovirt.org has posted comments on this change.
Change subject: volume: move metadata dict creation to volume.py ......................................................................
Patch Set 3:
* Update tracker::IGNORE, no Bug-Url found
vdsm-patches@lists.fedorahosted.org