[blivet:rhel7/master 03/16] Return None if the filesystem has no label (#1038590)
mulhern
amulhern at redhat.com
Thu Jan 16 16:10:04 UTC 2014
Related: rhbz#1038590
If the filesystem has no label the regular expression that matches the
output will match an empty string. Change that to None, because that's
what it means.
Signed-off-by: mulhern <amulhern at redhat.com>
---
blivet/formats/fs.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py
index e5101fb..064c8e8 100644
--- a/blivet/formats/fs.py
+++ b/blivet/formats/fs.py
@@ -629,7 +629,11 @@ class FS(DeviceFormat):
if label == "":
return None
else:
- return self._labelfs.extractLabel(label)
+ label = self._labelfs.extractLabel(label)
+ if label == "":
+ return None
+ else:
+ return label
def writeLabel(self):
"""Create a label on this filesystem.
--
1.8.3.1
More information about the anaconda-patches
mailing list