From: Josh Durgin Date: Fri, 21 Sep 2012 23:44:35 +0000 (-0700) Subject: Fix errors found by pyflakes X-Git-Tag: 1.1.0~2447 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=57bb434def782ae3e02db847e3fef6e2a04d72c4;p=teuthology.git Fix errors found by pyflakes A bunch of unused imports and variables. --- diff --git a/teuthology/misc.py b/teuthology/misc.py index f09486a9b..7e5c8d42e 100644 --- a/teuthology/misc.py +++ b/teuthology/misc.py @@ -11,7 +11,6 @@ import urllib2 import urlparse import yaml import json -import subprocess from teuthology import safepath from .orchestra import run diff --git a/teuthology/nuke.py b/teuthology/nuke.py index 09f1544a8..e90192ceb 100644 --- a/teuthology/nuke.py +++ b/teuthology/nuke.py @@ -1,6 +1,5 @@ import argparse import yaml -import subprocess def parse_args(): from teuthology.run import config_file diff --git a/teuthology/task/blktrace.py b/teuthology/task/blktrace.py index deae6c2b7..342887b34 100644 --- a/teuthology/task/blktrace.py +++ b/teuthology/task/blktrace.py @@ -1,10 +1,5 @@ -from cStringIO import StringIO - import contextlib import logging -import os -import re -import yaml from teuthology import misc as teuthology from teuthology import contextutil @@ -20,7 +15,7 @@ def setup(ctx, config): osds = ctx.cluster.only(teuthology.is_type('osd')) for remote, roles_for_host in osds.remotes.iteritems(): log.info('Creating %s on %s' % (log_dir,remote.name)) - proc = remote.run( + remote.run( args=['mkdir', '-p', '-m0755', '--', log_dir], wait=False, ) @@ -32,7 +27,6 @@ def execute(ctx, config): osds = ctx.cluster.only(teuthology.is_type('osd')) for remote, roles_for_host in osds.remotes.iteritems(): roles_to_devs = ctx.disk_config.remote_to_roles_to_dev[remote] - roles_to_journals = ctx.disk_config.remote_to_roles_to_journals[remote] for id_ in teuthology.roles_of_type(roles_for_host, 'osd'): if roles_to_devs.get(id_): dev = roles_to_devs[id_] diff --git a/teuthology/task/die_on_err.py b/teuthology/task/die_on_err.py index 4a7112d33..cfbda38cc 100644 --- a/teuthology/task/die_on_err.py +++ b/teuthology/task/die_on_err.py @@ -1,6 +1,5 @@ import contextlib import logging -import os import time from ..orchestra import run diff --git a/teuthology/task/kernel.py b/teuthology/task/kernel.py index 156a6efde..5c34433d9 100644 --- a/teuthology/task/kernel.py +++ b/teuthology/task/kernel.py @@ -289,7 +289,7 @@ def enable_disable_kdb(ctx, config): (role_remote,) = ctx.cluster.only(role).remotes.keys() if enable: log.info('Enabling kdb on {role}...'.format(role=role)) - proc = role_remote.run( + role_remote.run( args=[ 'echo', 'ttyS1', run.Raw('|'), @@ -297,7 +297,7 @@ def enable_disable_kdb(ctx, config): ]) else: log.info('Disabling kdb on {role}...'.format(role=role)) - proc = role_remote.run( + role_remote.run( args=[ 'echo', '', run.Raw('|'), diff --git a/teuthology/task/object_source_down.py b/teuthology/task/object_source_down.py index 7c69f91bb..dda6f04f9 100644 --- a/teuthology/task/object_source_down.py +++ b/teuthology/task/object_source_down.py @@ -1,7 +1,6 @@ import logging import ceph_manager from teuthology import misc as teuthology -import time log = logging.getLogger(__name__) diff --git a/teuthology/task/osd_recovery.py b/teuthology/task/osd_recovery.py index 27c2fdd7f..1f013640d 100644 --- a/teuthology/task/osd_recovery.py +++ b/teuthology/task/osd_recovery.py @@ -86,7 +86,7 @@ def task(ctx, config): # write some more (make sure osd.2 really is divergent) p = rados_start(mon, ['-p', 'rbd', 'bench', '15', 'write', '-b', '4096']) - err = p.exitstatus.get(); + p.exitstatus.get(); # revive divergent osd manager.revive_osd(2) @@ -141,13 +141,13 @@ def test_incomplete_pgs(ctx, config): # lots of objects in rbd (no pg log, will backfill) p = rados_start(mon, ['-p', 'rbd', 'bench', '30', 'write', '-b', '4096']) - err = p.exitstatus.get() + p.exitstatus.get() # few objects in metadata pool (with pg log, normal recovery) for f in range(1, 20): p = rados_start(mon, ['-p', 'metadata', 'put', 'foo.%d' % f, '/etc/passwd']) - err = p.exitstatus.get() + p.exitstatus.get() # move it back manager.raw_cluster_cmd('osd', 'in', '0', '1') diff --git a/teuthology/task/parallel_example.py b/teuthology/task/parallel_example.py index 4926259e4..43fb187cb 100644 --- a/teuthology/task/parallel_example.py +++ b/teuthology/task/parallel_example.py @@ -1,6 +1,5 @@ import contextlib import logging -import yaml from teuthology import misc as teuthology from teuthology import contextutil @@ -40,7 +39,7 @@ def task(ctx, config): """Take car of some yaml parsing here""" if config is not None and not isinstance(config, list) and not isinstance(config, dict): - assert(false), "task parallel_example only supports a list or dictionary for configuration" + assert(False), "task parallel_example only supports a list or dictionary for configuration" if config is None: config = ['client.{id}'.format(id=id_) for id_ in teuthology.all_roles_of_type(ctx.cluster, 'client')] diff --git a/teuthology/task/radosgw-admin.py b/teuthology/task/radosgw-admin.py index a8fd04e80..fd3025e9d 100644 --- a/teuthology/task/radosgw-admin.py +++ b/teuthology/task/radosgw-admin.py @@ -249,7 +249,7 @@ def task(ctx, config): # the 5th should fail. failed = False try: - bucket5 = connection.create_bucket(bucket_name + '5') + connection.create_bucket(bucket_name + '5') except: failed = True assert failed diff --git a/teuthology/task/rbd_fsx.py b/teuthology/task/rbd_fsx.py index 694ca5869..d2973babd 100644 --- a/teuthology/task/rbd_fsx.py +++ b/teuthology/task/rbd_fsx.py @@ -1,7 +1,6 @@ import contextlib import logging -from ..orchestra import run from teuthology.parallel import parallel log = logging.getLogger(__name__)