From f77934b19939796d7ab52daf4dac44846a2ad162 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 --- 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 69f4b595d44..25a590ad74d 100644 --- a/src/ceph-disk/ceph_disk/main.py +++ b/src/ceph-disk/ceph_disk/main.py @@ -150,6 +150,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.39.5