[blivet:master 01/10] Catch correct error and disable warning.

mulhern amulhern at redhat.com
Tue Mar 25 15:49:00 UTC 2014


If there are not enough fields, a ValueError is raised
because the unpacking of values does not succeed.

Disable the warning because rest is serving a legitimate function as a place
holder.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 blivet/devicetree.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index ea1f913..f47ba9e 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -2627,9 +2627,8 @@ class DeviceTree(object):
         log.info("collecting information about active mounts")
         for line in open("/proc/mounts").readlines():
             try:
-                (devspec, mountpoint, fstype, options, rest) = line.split(None,
-                                                                          4)
-            except IndexError:
+                (devspec, mountpoint, fstype, options, _rest) = line.split(None, 4)
+            except ValueError:
                 log.error("failed to parse /proc/mounts line: %s", line)
                 continue
 
-- 
1.8.3.1



More information about the anaconda-patches mailing list