Python 3.7 now shows a warning as below.
/usr/bin/ceph:128: DeprecationWarning: Using or importing the ABCs from
'collections' instead of from 'collections.abc' is deprecated, and in
3.8 it will stop working
import rados
This patch addresses the that particular issue.
Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
import os
from textwrap import dedent
import traceback
-from collections import namedtuple, defaultdict
+try:
+ from collections.abc import namedtuple, defaultdict
+except ImportError:
+ from collections import namedtuple, defaultdict
from teuthology.orchestra.run import CommandFailedError
from tasks.cephfs.cephfs_test_case import CephFSTestCase, for_teuthology
import json
import logging
-from collections import namedtuple
+try:
+ from collections.abc import namedtuple
+except ImportError:
+ from collections import namedtuple
from textwrap import dedent
from teuthology.orchestra.run import CommandFailedError
import os
from textwrap import dedent
import traceback
-from collections import namedtuple, defaultdict
+try:
+ from collections.abc import namedtuple, defaultdict
+except ImportError:
+ from collections import namedtuple, defaultdict
from teuthology.orchestra.run import CommandFailedError
from tasks.cephfs.cephfs_test_case import CephFSTestCase, for_teuthology
import logging
import os
import traceback
-from collections import namedtuple
+try:
+ from collections.abc import namedtuple
+except ImportError:
+ from collections import namedtuple
from teuthology.orchestra.run import CommandFailedError
from tasks.cephfs.cephfs_test_case import CephFSTestCase, for_teuthology
import json
import logging
-from collections import namedtuple
+try:
+ from collections.abc import namedtuple
+except ImportError:
+ from collections import namedtuple
import threading
import time
"""
from StringIO import StringIO
-from collections import defaultdict
+try:
+ from collections.abc import defaultdict
+except ImportError:
+ from collections import defaultdict
import getpass
import signal
import tempfile
-from collections import namedtuple
+try:
+ from collections.abc import namedtuple
+except ImportError:
+ from collections import namedtuple
sys_info = namedtuple('sys_info', ['devices'])
import socket
import struct
import time
-from collections import OrderedDict
+try:
+ from collections.abc import OrderedDict
+except ImportError:
+ from collections import OrderedDict
from fcntl import ioctl
from fnmatch import fnmatch
from prettytable import PrettyTable, HEADER
cimport rados
-from collections import namedtuple
+try:
+ from collections.abc import namedtuple
+except ImportError:
+ from collections import namedtuple
from datetime import datetime
import errno
import os
# -*- coding: utf-8 -*-
from __future__ import absolute_import
-from collections import defaultdict
+try:
+ from collections.abc import defaultdict
+except ImportError:
+ from collections import defaultdict
import cherrypy
from __future__ import absolute_import
import time
-import collections
-from collections import defaultdict
+try:
+ import collections.abc
+ from collections.abc import defaultdict
+except ImportError:
+ import collections
+ from collections import defaultdict
import json
import rados
import logging
import six
import threading
-from collections import defaultdict
+try:
+ from collections.abc import defaultdict
+except ImportError:
+ from collections import defaultdict
import rados
PG_STATES = [
from pecan.rest import RestController
from restful import common, context
-from collections import defaultdict
+try:
+ from collections.abc import defaultdict
+except ImportError:
+ from collections import defaultdict
from restful.decorators import auth
High level status display commands
"""
-from collections import defaultdict
+try:
+ from collections.abc import defaultdict
+except ImportError:
+ from collections import defaultdict
from prettytable import PrettyTable
import errno
import fnmatch
import time
from datetime import datetime
from threading import Event
-from collections import defaultdict
+try:
+ from collections.abc import defaultdict
+except ImportError:
+ from collections import defaultdict
from mgr_module import MgrModule
import threading
import time
-from collections import Callable
+try:
+ from collections.abc import Callable
+except ImportError:
+ from collections import Callable
from datetime import datetime
from functools import partial, wraps
from itertools import chain
from libc.stdlib cimport realloc, free
from libc.string cimport strdup
-from collections import Iterable
+try:
+ from collections.abc import Iterable
+except ImportError:
+ from collections import Iterable
from datetime import datetime
cimport rados
cimport rados
-from collections import namedtuple
+try:
+ from collections.abc import namedtuple
+except ImportError:
+ from collections import namedtuple
from datetime import datetime
import errno
#!/usr/bin/python
from __future__ import print_function
-from collections import Counter
+try:
+ from collections.abc import Counter
+except ImportError:
+ from collections import Counter
import argparse
import json
import re