]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: cast output of subprocess.Popen() to str() 122/head
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 20 Mar 2013 13:36:58 +0000 (14:36 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 20 Mar 2013 13:36:58 +0000 (14:36 +0100)
Cast output of subprocess.Popen() to str() to be able to use
str.split() and str.splitlines() without warnings from pylint.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/ceph-disk

index 6d98fc32ada1692822892d37e38d0f5292a13822..1cf8ba9659668a38845583653cd2191814ab32cf 100755 (executable)
@@ -373,7 +373,7 @@ def get_conf(cluster, variable):
         return None
     elif ret != 0:
         raise Error('getting variable from configuration failed')
-    value = out.split('\n', 1)[0]
+    value = str(out).split('\n', 1)[0]
     # don't differentiate between "var=" and no var set
     if not value:
         return None
@@ -406,7 +406,7 @@ def get_conf_with_default(cluster, variable):
             e,
             )
 
-    value = out.split('\n', 1)[0]
+    value = str(out).split('\n', 1)[0]
     return value
 
 
@@ -552,7 +552,7 @@ def get_free_partition_index(dev):
 
     if not lines:
         raise Error('parted failed to output anything')
-    lines = lines.splitlines(True)
+    lines = str(lines).splitlines(True)
 
     if lines[0] not in ['CHS;\n', 'CYL;\n', 'BYT;\n']:
         raise Error('weird parted units', lines[0])