]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/ceph-disk/ceph_disk/main.py
update sources to v12.2.3
[ceph.git] / ceph / src / ceph-disk / ceph_disk / main.py
index 6516750d22688325d4270542db4d13ebf6846273..f8ef35503ed044d7eae5ff6f030f6be6306bf3bd 100644 (file)
@@ -42,23 +42,12 @@ import pwd
 import grp
 import textwrap
 import glob
-import warnings
 
 CEPH_OSD_ONDISK_MAGIC = 'ceph osd volume v026'
 CEPH_LOCKBOX_ONDISK_MAGIC = 'ceph lockbox volume v001'
 
 KEY_MANAGEMENT_MODE_V1 = 'ceph-mon v1'
 
-DEPRECATION_WARNING = """
-*******************************************************************************
-This tool is now deprecated in favor of ceph-volume.
-It is recommended to use ceph-volume for OSD deployments. For details see:
-
-    http://docs.ceph.com/docs/master/ceph-volume/#migrating
-
-*******************************************************************************
-"""
-
 PTYPE = {
     'regular': {
         'journal': {
@@ -162,6 +151,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):
 
@@ -1258,7 +1254,8 @@ def get_fsid(cluster):
     :return: The fsid or raises Error.
     """
     fsid = get_conf_with_default(cluster=cluster, variable='fsid')
-    if fsid is None:
+    # uuids from boost always default to 'the empty uuid'
+    if fsid == '00000000-0000-0000-0000-000000000000':
         raise Error('getting cluster uuid from configuration failed')
     return fsid.lower()
 
@@ -5649,8 +5646,6 @@ def make_zap_parser(subparsers):
 
 
 def main(argv):
-    # Deprecate from the very beginning
-    warnings.warn(DEPRECATION_WARNING)
     args = parse_args(argv)
 
     setup_logging(args.verbose, args.log_stdout)
@@ -5670,20 +5665,10 @@ def main(argv):
     CEPH_PREF_GROUP = args.setgroup
 
     if args.verbose:
-        try:
-            args.func(args)
-        except Exception:
-            # warn on any exception when running with verbosity
-            warnings.warn(DEPRECATION_WARNING)
-            # but still raise the original issue
-            raise
-
+        args.func(args)
     else:
         main_catch(args.func, args)
 
-    # if there aren't any errors, still log again at the very bottom
-    warnings.warn(DEPRECATION_WARNING)
-
 
 def setup_logging(verbose, log_stdout):
     loglevel = logging.WARNING
@@ -5710,8 +5695,6 @@ def main_catch(func, args):
         func(args)
 
     except Error as e:
-        # warn on generic 'error' exceptions
-        warnings.warn(DEPRECATION_WARNING)
         raise SystemExit(
             '{prog}: {msg}'.format(
                 prog=args.prog,
@@ -5720,8 +5703,6 @@ def main_catch(func, args):
         )
 
     except CephDiskException as error:
-        # warn on ceph-disk exceptions
-        warnings.warn(DEPRECATION_WARNING)
         exc_name = error.__class__.__name__
         raise SystemExit(
             '{prog} {exc_name}: {msg}'.format(