]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
ceph-disk: compatibility fix for python 3 24008/head
authorTim Serong <tserong@suse.com>
Mon, 10 Sep 2018 10:27:11 +0000 (20:27 +1000)
committerTim Serong <tserong@suse.com>
Wed, 12 Sep 2018 06:45:26 +0000 (16:45 +1000)
commit8e3d948ff4c3b19dc55b9a5ae63f5b63f0c476a3
tree1542c712b681c3d485197fd9123e98aea0af3498
parent510d48e10be716cf61b9ddd51e8bc847288ae15a
ceph-disk: compatibility fix for python 3

In python 3, dev is a string, but mounts_dev is bytes (because
/proc/mounts was opened with mode 'rb') so they can't compare
equal, resulting in is_mounted() returning None for mounted OSDs.
The safest fix for this we could come up with was to normalize
dev to a str using _bytes2str() (just in case), and open
/proc/mounts in mode 'r', so its lines are interpreted as strs.

Fixes: https://tracker.ceph.com/issues/35906
Signed-off-by: Tim Serong <tserong@suse.com>
src/ceph-disk/ceph_disk/main.py