#!/usr/bin/python3
-from __future__ import print_function
-from subprocess import call
-try:
- from subprocess import check_output
-except ImportError:
- def check_output(*popenargs, **kwargs):
- import subprocess
- # backported from python 2.7 stdlib
- process = subprocess.Popen(
- stdout=subprocess.PIPE, *popenargs, **kwargs)
- output, unused_err = process.communicate()
- retcode = process.poll()
- if retcode:
- cmd = kwargs.get("args")
- if cmd is None:
- cmd = popenargs[0]
- error = subprocess.CalledProcessError(retcode, cmd)
- error.output = output
- raise error
- return output
+from subprocess import call, check_output, DEVNULL
import filecmp
import os
import tempfile
import platform
-try:
- from subprocess import DEVNULL
-except ImportError:
- DEVNULL = open(os.devnull, "wb")
-
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.WARNING,
datefmt="%FT%T")
import os
from io import BytesIO, StringIO
+from subprocess import DEVNULL
from teuthology import misc as teuthology
from tasks.scrub import Scrubber
from tasks.util.rados import cmd_erasure_code_profile
from teuthology.exceptions import CommandFailedError
from tasks.thrasher import Thrasher
-try:
- from subprocess import DEVNULL # py3k
-except ImportError:
- DEVNULL = open(os.devnull, 'r+') # type: ignore
DEFAULT_CONF_PATH = '/etc/ceph/ceph.conf'