Hello Allon Mureinik,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/45761
to review the following change.
Change subject: volume: fix failing metadata parsing
......................................................................
volume: fix failing metadata parsing
The call to "split" in file and block volumes expects only one "="
per
line. This is not a good behavior since there might be fields that
contain some more "=" (like Description).
This patch limits the number of splits to 1, so that the fields values
can contains some other "=".
Change-Id: Ie84bf5e42d2c4949944a5f348615d6fe80f72fa2
Backport-To: 3.6
Bug-Url:
https://bugzilla.redhat.com/1258835
Signed-off-by: Idan Shaby <ishaby(a)redhat.com>
Reviewed-on:
https://gerrit.ovirt.org/45585
Reviewed-by: Nir Soffer <nsoffer(a)redhat.com>
Reviewed-by: Allon Mureinik <amureini(a)redhat.com>
Continuous-Integration: Jenkins CI
---
M vdsm/storage/blockVolume.py
M vdsm/storage/fileVolume.py
2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/61/45761/1
diff --git a/vdsm/storage/blockVolume.py b/vdsm/storage/blockVolume.py
index 9ab5ca4..ac29f40 100644
--- a/vdsm/storage/blockVolume.py
+++ b/vdsm/storage/blockVolume.py
@@ -595,7 +595,7 @@
return out
if l.find("=") < 0:
continue
- key, value = l.split("=")
+ key, value = l.split("=", 1)
out[key.strip()] = value.strip()
except Exception as e:
diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py
index 20573bd..1259472 100644
--- a/vdsm/storage/fileVolume.py
+++ b/vdsm/storage/fileVolume.py
@@ -300,7 +300,7 @@
return out
if l.find("=") < 0:
continue
- key, value = l.split("=")
+ key, value = l.split("=", 1)
out[key.strip()] = value.strip()
except Exception as e:
--
To view, visit
https://gerrit.ovirt.org/45761
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie84bf5e42d2c4949944a5f348615d6fe80f72fa2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Idan Shaby <ishaby(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>