From 753279aac6beeacda7fb7c7d15129dff1a27d214 Mon Sep 17 00:00:00 2001 From: Song Shun Date: Tue, 28 Nov 2017 11:28:43 +0800 Subject: [PATCH] ceph-disk: fix signed integer is greater than maximum when call major fix signed integer is greater than maximum when call os.major using python 2.7.5 in Centos 7 Signed-off-by: Song Shun (cherry picked from commit f77934b19939796d7ab52daf4dac44846a2ad162) --- src/ceph-disk/ceph_disk/main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ceph-disk/ceph_disk/main.py b/src/ceph-disk/ceph_disk/main.py index 6516750d22688..8e95d1cff6795 100644 --- a/src/ceph-disk/ceph_disk/main.py +++ b/src/ceph-disk/ceph_disk/main.py @@ -162,6 +162,13 @@ PTYPE = { }, } +try: + # see https://bugs.python.org/issue23098 + os.major(0x80002b00) +except OverflowError: + os.major = lambda devid: ((devid >> 8) & 0xfff) | ((devid >> 32) & ~0xfff) + os.minor = lambda devid: (devid & 0xff) | ((devid >> 12) & ~0xff) + class Ptype(object): -- 2.47.3