import logging
import os
-import six
-
from teuthology import misc as teuthology
from teuthology.parallel import parallel
from teuthology.orchestra import run
log.info('Making a separate scratch dir for every client...')
for role in config.keys():
- assert isinstance(role, six.string_types)
+ assert isinstance(role, str)
PREFIX = 'client.'
assert role.startswith(PREFIX)
id_ = role[len(PREFIX):]
"""
Spawned to run test on remote site
"""
- assert isinstance(role, six.string_types)
+ assert isinstance(role, str)
PREFIX = 'client.'
assert role.startswith(PREFIX)
id_ = role[len(PREFIX):]
import logging
import os
-import six
-
from tasks.util.workunit import get_refspec_after_overrides
from teuthology import misc as teuthology
:param ctx: Context
:param role: Roles
"""
- assert isinstance(role, six.string_types)
+ assert isinstance(role, str)
PREFIX = 'client.'
assert role.startswith(PREFIX)
id_ = role[len(PREFIX):]
#!/usr/bin/env python
import contextlib
import logging
-from io import BytesIO
import textwrap
-from configparser import ConfigParser
-
-import six
import time
+from configparser import ConfigParser
+from io import BytesIO, StringIO
from teuthology.orchestra import run
from teuthology import misc
parser.read_file(config_stream)
for (key, value) in update_dict.items():
parser.set(section, key, value)
- out_stream = six.StringIO()
+ out_stream = StringIO()
parser.write(out_stream)
out_stream.seek(0)
return out_stream
file_name = update['name']
options = update['options']
config_data = misc.get_file(devstack_node, file_name, sudo=True)
- config_stream = six.StringIO(config_data)
+ config_stream = StringIO(config_data)
backup_config(devstack_node, file_name)
new_config_stream = update_config(file_name, config_stream, options)
misc.sudo_write_file(devstack_node, file_name, new_config_stream)
import contextlib
import logging
-import six
-
from teuthology.orchestra import run
from teuthology import misc as teuthology
testdir = teuthology.get_testdir(ctx)
print(str(config.get('increment',-1)))
for role in config.get('clients', ['client.0']):
- assert isinstance(role, six.string_types)
+ assert isinstance(role, str)
PREFIX = 'client.'
assert role.startswith(PREFIX)
id_ = role[len(PREFIX):]
import gevent
from teuthology import misc as teuthology
-import six
from teuthology.orchestra import run
existing_pools = config.get('pools', [])
created_pools = []
for role in config.get('clients', clients):
- assert isinstance(role, six.string_types)
+ assert isinstance(role, str)
PREFIX = 'client.'
assert role.startswith(PREFIX)
id_ = role[len(PREFIX):]
from teuthology.orchestra import run
from teuthology import misc as teuthology
-import six
log = logging.getLogger(__name__)
create_pool = config.get('create_pool', True)
for role in config.get('clients', ['client.0']):
- assert isinstance(role, six.string_types)
+ assert isinstance(role, str)
PREFIX = 'client.'
assert role.startswith(PREFIX)
id_ = role[len(PREFIX):]
from teuthology.orchestra import run
from teuthology import misc as teuthology
-import six
log = logging.getLogger(__name__)
log.info(' repetition =' + str(rep))
for role in config.get('clients', ['client.0']):
- assert isinstance(role, six.string_types)
+ assert isinstance(role, str)
PREFIX = 'client.'
assert role.startswith(PREFIX)
id_ = role[len(PREFIX):]
"""
watch_notify_same_primary task
"""
-from six import StringIO
+from io import StringIO
import contextlib
import logging
-import six
from teuthology.orchestra import run
from teuthology.contextutil import safe_while
clients = config.get('clients', ['client.0'])
assert len(clients) == 1
role = clients[0]
- assert isinstance(role, six.string_types)
+ assert isinstance(role, str)
PREFIX = 'client.'
assert role.startswith(PREFIX)
(remote,) = ctx.cluster.only(role).remotes.keys()
import contextlib
import logging
-import six
from teuthology.orchestra import run
from teuthology.task import proc_thrasher
remotes = []
for role in config.get('clients', ['client.0']):
- assert isinstance(role, six.string_types)
+ assert isinstance(role, str)
PREFIX = 'client.'
assert role.startswith(PREFIX)
id_ = role[len(PREFIX):]
import io
import re
-import six
-
from ceph_argparse import * # noqa
keyring_base = '/tmp/cephtest-caps.keyring'
if isinstance(cmd, list):
self.cmd = ' '.join(cmd)
else:
- assert isinstance(cmd, str) or isinstance(cmd, six.text_type), \
- 'cmd needs to be either a list or a str'
+ assert isinstance(cmd, str), 'cmd needs to be either a list or a str'
self.cmd = cmd
self.cmd = str(self.cmd)
self.ret = int(ret)
def call(cmd):
if isinstance(cmd, list):
args = cmd
- elif isinstance(cmd, str) or isinstance(cmd, six.text_type):
+ elif isinstance(cmd, str):
args = shlex.split(cmd)
else:
assert False, 'cmd is not a string/unicode nor a list!'
return p
-def expect_to_file(cmd, expected_ret, out_file, mode='a'):
+def expect_to_file(cmd, expected_ret, out_file):
# Let the exception be propagated to the caller
p = expect(cmd, expected_ret)
assert p.returncode == expected_ret, \
'expected result doesn\'t match and no exception was thrown!'
- with io.open(out_file, mode) as file:
- file.write(six.text_type(p.stdout.read()))
+ with io.open(out_file, 'ab') as file:
+ file.write(p.stdout.read())
return p
self.args = []
for s in j['sig']:
if not isinstance(s, dict):
- assert isinstance(s, str) or isinstance(s,six.text_type), \
+ assert isinstance(s, str), \
'malformatted signature cid {0}: {1}\n{2}'.format(cid,s,j)
if len(self.sig) > 0:
self.sig += ' '
import shlex
import subprocess
-import six
-
class UnexpectedReturn(Exception):
def __init__(self, cmd, ret, expected, msg):
if isinstance(cmd, list):
self.cmd = ' '.join(cmd)
else:
- assert isinstance(cmd, six.string_types) or isinstance(cmd, six.text_type), \
+ assert isinstance(cmd, str), \
'cmd needs to be either a list or a str'
self.cmd = cmd
self.cmd = str(self.cmd)
def call(cmd):
if isinstance(cmd, list):
args = cmd
- elif isinstance(cmd, six.string_types) or isinstance(cmd, six.text_type):
+ elif isinstance(cmd, str):
args = shlex.split(cmd)
else:
assert False, 'cmd is not a string/unicode nor a list!'
from flask import abort, Flask, request, Response
from hashlib import sha1 as sha
from time import gmtime, strftime
-from six.moves.urllib.parse import urlparse
+from urllib.parse import urlparse
import argparse
import base64
import hmac