mirror of
https://github.com/ceph/ceph
synced 2025-03-25 11:48:05 +00:00
Remove unused variables
(cherry picked from commit 581b6b3e977b99fc58fe25e66c933c65e38dc87c)
This commit is contained in:
parent
8497437003
commit
8a11e4d053
@ -337,6 +337,7 @@ def move_file(remote, from_path, to_path, sudo=False):
|
|||||||
stdout=StringIO(),
|
stdout=StringIO(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def delete_file(remote, path, sudo=False, force=False):
|
def delete_file(remote, path, sudo=False, force=False):
|
||||||
args = []
|
args = []
|
||||||
if sudo:
|
if sudo:
|
||||||
@ -345,14 +346,15 @@ def delete_file(remote, path, sudo=False, force=False):
|
|||||||
if force:
|
if force:
|
||||||
args.extend(['-f'])
|
args.extend(['-f'])
|
||||||
args.extend([
|
args.extend([
|
||||||
'--',
|
'--',
|
||||||
path,
|
path,
|
||||||
])
|
])
|
||||||
proc = remote.run(
|
remote.run(
|
||||||
args=args,
|
args=args,
|
||||||
stdout=StringIO(),
|
stdout=StringIO(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def remove_lines_from_file(remote, path, line_is_valid_test, string_to_test_for):
|
def remove_lines_from_file(remote, path, line_is_valid_test, string_to_test_for):
|
||||||
# read in the specified file
|
# read in the specified file
|
||||||
in_data = get_file(remote, path, False)
|
in_data = get_file(remote, path, False)
|
||||||
@ -414,6 +416,7 @@ def remote_mktemp(remote, sudo=False):
|
|||||||
data = proc.stdout.getvalue()
|
data = proc.stdout.getvalue()
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
def create_file(remote, path, data="", permissions=str(644), sudo=False):
|
def create_file(remote, path, data="", permissions=str(644), sudo=False):
|
||||||
"""
|
"""
|
||||||
Create a file on the remote host.
|
Create a file on the remote host.
|
||||||
@ -422,15 +425,15 @@ def create_file(remote, path, data="", permissions=str(644), sudo=False):
|
|||||||
if sudo:
|
if sudo:
|
||||||
args.append('sudo')
|
args.append('sudo')
|
||||||
args.extend([
|
args.extend([
|
||||||
'touch',
|
'touch',
|
||||||
path,
|
path,
|
||||||
run.Raw('&&'),
|
run.Raw('&&'),
|
||||||
'chmod',
|
'chmod',
|
||||||
permissions,
|
permissions,
|
||||||
'--',
|
'--',
|
||||||
path
|
path
|
||||||
])
|
])
|
||||||
proc = remote.run(
|
remote.run(
|
||||||
args=args,
|
args=args,
|
||||||
stdout=StringIO(),
|
stdout=StringIO(),
|
||||||
)
|
)
|
||||||
@ -438,6 +441,7 @@ def create_file(remote, path, data="", permissions=str(644), sudo=False):
|
|||||||
if "" != data:
|
if "" != data:
|
||||||
append_lines_to_file(remote, path, data, sudo)
|
append_lines_to_file(remote, path, data, sudo)
|
||||||
|
|
||||||
|
|
||||||
def get_file(remote, path, sudo=False):
|
def get_file(remote, path, sudo=False):
|
||||||
"""
|
"""
|
||||||
Read a file from remote host into memory.
|
Read a file from remote host into memory.
|
||||||
|
@ -287,7 +287,6 @@ def _update_rpm_package_list_and_install(ctx, remote, rpm, config):
|
|||||||
host = ctx.teuthology_config.get('gitbuilder_host',
|
host = ctx.teuthology_config.get('gitbuilder_host',
|
||||||
'gitbuilder.ceph.com')
|
'gitbuilder.ceph.com')
|
||||||
dist_release = baseparms['dist_release']
|
dist_release = baseparms['dist_release']
|
||||||
distro_release = baseparms['distro_release']
|
|
||||||
start_of_url = 'http://{host}/ceph-rpm-{distro_release}-{arch}-{flavor}/{uri}'.format(host=host, **baseparms)
|
start_of_url = 'http://{host}/ceph-rpm-{distro_release}-{arch}-{flavor}/{uri}'.format(host=host, **baseparms)
|
||||||
ceph_release = 'ceph-release-{release}.{dist_release}.noarch'.format(
|
ceph_release = 'ceph-release-{release}.{dist_release}.noarch'.format(
|
||||||
release=RELEASE, dist_release=dist_release)
|
release=RELEASE, dist_release=dist_release)
|
||||||
|
@ -5,6 +5,7 @@ from teuthology import misc as teuthology
|
|||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
def task(ctx, config):
|
def task(ctx, config):
|
||||||
"""
|
"""
|
||||||
@ -35,8 +36,6 @@ def task(ctx, config):
|
|||||||
for id_ in teuthology.all_roles_of_type(ctx.cluster, 'client')]
|
for id_ in teuthology.all_roles_of_type(ctx.cluster, 'client')]
|
||||||
clients = list(teuthology.get_clients(ctx=ctx, roles=config))
|
clients = list(teuthology.get_clients(ctx=ctx, roles=config))
|
||||||
|
|
||||||
testdir = teuthology.get_testdir(ctx)
|
|
||||||
|
|
||||||
for id_, remote in clients:
|
for id_, remote in clients:
|
||||||
# TODO: Don't have to run this more than once per node (remote)
|
# TODO: Don't have to run this more than once per node (remote)
|
||||||
log.info('Enable logging on client.{id} at {remote} ...'.format(
|
log.info('Enable logging on client.{id} at {remote} ...'.format(
|
||||||
|
@ -3,10 +3,10 @@ import logging
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from teuthology import misc as teuthology
|
from teuthology import misc as teuthology
|
||||||
from ..orchestra import run
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
def task(ctx, config):
|
def task(ctx, config):
|
||||||
"""
|
"""
|
||||||
|
@ -735,7 +735,6 @@ def task(ctx, config):
|
|||||||
assert err
|
assert err
|
||||||
|
|
||||||
# delete should fail because ``key`` still exists
|
# delete should fail because ``key`` still exists
|
||||||
fails = False
|
|
||||||
try:
|
try:
|
||||||
bucket.delete()
|
bucket.delete()
|
||||||
except boto.exception.S3ResponseError as e:
|
except boto.exception.S3ResponseError as e:
|
||||||
|
@ -8,13 +8,12 @@ from teuthology.task.ceph import CephState
|
|||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
def run_rest_api_daemon(ctx, api_clients):
|
def run_rest_api_daemon(ctx, api_clients):
|
||||||
if not hasattr(ctx, 'daemons'):
|
if not hasattr(ctx, 'daemons'):
|
||||||
ctx.daemons = CephState()
|
ctx.daemons = CephState()
|
||||||
remotes = ctx.cluster.only(teuthology.is_type('client')).remotes
|
remotes = ctx.cluster.only(teuthology.is_type('client')).remotes
|
||||||
testdir = teuthology.get_testdir(ctx)
|
|
||||||
coverage_dir = '{tdir}/archive/coverage'.format(tdir=testdir)
|
|
||||||
for rems, roles in remotes.iteritems():
|
for rems, roles in remotes.iteritems():
|
||||||
for whole_id_ in roles:
|
for whole_id_ in roles:
|
||||||
if whole_id_ in api_clients:
|
if whole_id_ in api_clients:
|
||||||
|
@ -46,6 +46,6 @@ def task(ctx, config):
|
|||||||
exc_info = sys.exc_info()
|
exc_info = sys.exc_info()
|
||||||
while stack:
|
while stack:
|
||||||
mgr = stack.pop()
|
mgr = stack.pop()
|
||||||
endr = mgr.__exit__(*exc_info)
|
mgr.__exit__(*exc_info)
|
||||||
finally:
|
finally:
|
||||||
del exc_info
|
del exc_info
|
||||||
|
@ -32,8 +32,6 @@ def task(ctx, config):
|
|||||||
|
|
||||||
remotes = []
|
remotes = []
|
||||||
|
|
||||||
testdir = teuthology.get_testdir(ctx)
|
|
||||||
|
|
||||||
for role in config.get('clients', ['client.0']):
|
for role in config.get('clients', ['client.0']):
|
||||||
assert isinstance(role, basestring)
|
assert isinstance(role, basestring)
|
||||||
PREFIX = 'client.'
|
PREFIX = 'client.'
|
||||||
|
@ -113,7 +113,7 @@ def radosgw_agent_sync(ctx, agent_host, agent_port):
|
|||||||
def radosgw_agent_sync_all(ctx):
|
def radosgw_agent_sync_all(ctx):
|
||||||
if ctx.radosgw_agent.procs:
|
if ctx.radosgw_agent.procs:
|
||||||
for agent_client, c_config in ctx.radosgw_agent.config.iteritems():
|
for agent_client, c_config in ctx.radosgw_agent.config.iteritems():
|
||||||
dest_zone = zone_for_client(ctx, agent_client)
|
zone_for_client(ctx, agent_client)
|
||||||
sync_host, sync_port = get_sync_agent(ctx, agent_client)
|
sync_host, sync_port = get_sync_agent(ctx, agent_client)
|
||||||
log.debug('doing a sync via {host1}'.format(host1=sync_host))
|
log.debug('doing a sync via {host1}'.format(host1=sync_host))
|
||||||
radosgw_agent_sync(ctx, sync_host, sync_port)
|
radosgw_agent_sync(ctx, sync_host, sync_port)
|
||||||
|
Loading…
Reference in New Issue
Block a user