]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
ceph-disk: compatibility fix for python 3 24347/head
authorTim Serong <tserong@suse.com>
Mon, 10 Sep 2018 10:27:11 +0000 (20:27 +1000)
committerPrashant D <pdhange@redhat.com>
Mon, 1 Oct 2018 02:38:29 +0000 (22:38 -0400)
commitbd92d11a3a6b9d8036708dc3e617210d9a04a6ed
tree81457c49be802e79531c98cce51b9897a5232aeb
parent08189fcb27207dc0fef7aaf60b5510b7e97e4aab
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>
(cherry picked from commit 8e3d948ff4c3b19dc55b9a5ae63f5b63f0c476a3)
src/ceph-disk/ceph_disk/main.py