[blivet:master 21/25] Do not use strip() incorrectly

mulhern amulhern at redhat.com
Wed Apr 16 21:54:42 UTC 2014


split() is correct and will handle possible trailing whitespace better than
a slice.

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

diff --git a/blivet/arch.py b/blivet/arch.py
index 24f4408..f4dd23e 100644
--- a/blivet/arch.py
+++ b/blivet/arch.py
@@ -363,9 +363,8 @@ def bits():
         # "<number>bit"
         # so we remove the bit suffix and convert the
         # number to an integer
-        bits = bits.strip("bit")
-        bits = int(bits)
-        return bits
+        (bits, _rest) = bits.split("bit", 1)
+        return int(bits)
     except Exception as e:
         log.error("architecture word size detection failed: %s", e)
         return None
-- 
1.8.3.1



More information about the anaconda-patches mailing list