diff options
author | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2013-03-20 14:36:58 +0100 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-04-26 13:40:05 -0700 |
commit | e92baf5081a43ff3290eb934612a11fbed946469 (patch) | |
tree | cb73656314213ee6e53b46623c5feda2f4b91386 | |
parent | 1ffc89af1954643426708987a09291463bd7525b (diff) | |
download | ceph-e92baf5081a43ff3290eb934612a11fbed946469.tar.gz |
ceph-disk: cast output of subprocess.Popen() to str()
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>
(cherry picked from commit 87691dc46edfba11c370592dbb533772190be4b2)
-rwxr-xr-x | src/ceph-disk | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ceph-disk b/src/ceph-disk index 7de946e2985..7804021580a 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -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]) |