mirror of
https://github.com/ceph/ceph
synced 2025-03-23 02:38:31 +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(),
|
||||
)
|
||||
|
||||
|
||||
def delete_file(remote, path, sudo=False, force=False):
|
||||
args = []
|
||||
if sudo:
|
||||
@ -345,14 +346,15 @@ def delete_file(remote, path, sudo=False, force=False):
|
||||
if force:
|
||||
args.extend(['-f'])
|
||||
args.extend([
|
||||
'--',
|
||||
path,
|
||||
])
|
||||
proc = remote.run(
|
||||
'--',
|
||||
path,
|
||||
])
|
||||
remote.run(
|
||||
args=args,
|
||||
stdout=StringIO(),
|
||||
)
|
||||
|
||||
|
||||
def remove_lines_from_file(remote, path, line_is_valid_test, string_to_test_for):
|
||||
# read in the specified file
|
||||
in_data = get_file(remote, path, False)
|
||||
@ -414,6 +416,7 @@ def remote_mktemp(remote, sudo=False):
|
||||
data = proc.stdout.getvalue()
|
||||
return data
|
||||
|
||||
|
||||
def create_file(remote, path, data="", permissions=str(644), sudo=False):
|
||||
"""
|
||||
Create a file on the remote host.
|
||||
@ -422,15 +425,15 @@ def create_file(remote, path, data="", permissions=str(644), sudo=False):
|
||||
if sudo:
|
||||
args.append('sudo')
|
||||
args.extend([
|
||||
'touch',
|
||||
path,
|
||||
run.Raw('&&'),
|
||||
'chmod',
|
||||
permissions,
|
||||
'--',
|
||||
path
|
||||
])
|
||||
proc = remote.run(
|
||||
'touch',
|
||||
path,
|
||||
run.Raw('&&'),
|
||||
'chmod',
|
||||
permissions,
|
||||
'--',
|
||||
path
|
||||
])
|
||||
remote.run(
|
||||
args=args,
|
||||
stdout=StringIO(),
|
||||
)
|
||||
@ -438,6 +441,7 @@ def create_file(remote, path, data="", permissions=str(644), sudo=False):
|
||||
if "" != data:
|
||||
append_lines_to_file(remote, path, data, sudo)
|
||||
|
||||
|
||||
def get_file(remote, path, sudo=False):
|
||||
"""
|
||||
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',
|
||||
'gitbuilder.ceph.com')
|
||||
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)
|
||||
ceph_release = 'ceph-release-{release}.{dist_release}.noarch'.format(
|
||||
release=RELEASE, dist_release=dist_release)
|
||||
|
@ -5,6 +5,7 @@ from teuthology import misc as teuthology
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def task(ctx, config):
|
||||
"""
|
||||
@ -35,8 +36,6 @@ def task(ctx, config):
|
||||
for id_ in teuthology.all_roles_of_type(ctx.cluster, 'client')]
|
||||
clients = list(teuthology.get_clients(ctx=ctx, roles=config))
|
||||
|
||||
testdir = teuthology.get_testdir(ctx)
|
||||
|
||||
for id_, remote in clients:
|
||||
# TODO: Don't have to run this more than once per node (remote)
|
||||
log.info('Enable logging on client.{id} at {remote} ...'.format(
|
||||
|
@ -3,10 +3,10 @@ import logging
|
||||
import os
|
||||
|
||||
from teuthology import misc as teuthology
|
||||
from ..orchestra import run
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def task(ctx, config):
|
||||
"""
|
||||
|
@ -735,7 +735,6 @@ def task(ctx, config):
|
||||
assert err
|
||||
|
||||
# delete should fail because ``key`` still exists
|
||||
fails = False
|
||||
try:
|
||||
bucket.delete()
|
||||
except boto.exception.S3ResponseError as e:
|
||||
|
@ -8,13 +8,12 @@ from teuthology.task.ceph import CephState
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def run_rest_api_daemon(ctx, api_clients):
|
||||
if not hasattr(ctx, 'daemons'):
|
||||
ctx.daemons = CephState()
|
||||
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 whole_id_ in roles:
|
||||
if whole_id_ in api_clients:
|
||||
|
@ -46,6 +46,6 @@ def task(ctx, config):
|
||||
exc_info = sys.exc_info()
|
||||
while stack:
|
||||
mgr = stack.pop()
|
||||
endr = mgr.__exit__(*exc_info)
|
||||
mgr.__exit__(*exc_info)
|
||||
finally:
|
||||
del exc_info
|
||||
|
@ -32,8 +32,6 @@ def task(ctx, config):
|
||||
|
||||
remotes = []
|
||||
|
||||
testdir = teuthology.get_testdir(ctx)
|
||||
|
||||
for role in config.get('clients', ['client.0']):
|
||||
assert isinstance(role, basestring)
|
||||
PREFIX = 'client.'
|
||||
|
@ -113,7 +113,7 @@ def radosgw_agent_sync(ctx, agent_host, agent_port):
|
||||
def radosgw_agent_sync_all(ctx):
|
||||
if ctx.radosgw_agent.procs:
|
||||
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)
|
||||
log.debug('doing a sync via {host1}'.format(host1=sync_host))
|
||||
radosgw_agent_sync(ctx, sync_host, sync_port)
|
||||
|
Loading…
Reference in New Issue
Block a user