]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_objectstore_tool: fix flake8 issues
authorDavid Zafman <dzafman@redhat.com>
Thu, 20 Nov 2014 17:39:50 +0000 (09:39 -0800)
committerDavid Zafman <dzafman@redhat.com>
Wed, 4 Mar 2015 00:03:59 +0000 (16:03 -0800)
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit a09d3a389dbb3dea8bb337c5b2af7b172ccc66d5)

tasks/ceph_objectstore_tool.py

index e1ca2686467787171abeb29b21aa31d95f5a3a9a..8e0dab0aeada31908dcd151aa0d5f6f5c4ffc735 100644 (file)
@@ -2,7 +2,6 @@
 ceph_objectstore_tool - Simple test of ceph_objectstore_tool utility
 """
 from cStringIO import StringIO
-from subprocess import call
 import contextlib
 import logging
 import ceph_manager
@@ -31,7 +30,7 @@ def cod_setup_local_data(log, ctx, NUM_OBJECTS, DATADIR, BASE_NAME, DATALINECOUN
     objects = range(1, NUM_OBJECTS + 1)
     for i in objects:
         NAME = BASE_NAME + "{num}".format(num=i)
-        LOCALNAME=os.path.join(DATADIR, NAME)
+        LOCALNAME = os.path.join(DATADIR, NAME)
 
         dataline = range(DATALINECOUNT)
         fd = open(LOCALNAME, "w")
@@ -73,7 +72,7 @@ def cod_setup(log, ctx, remote, NUM_OBJECTS, DATADIR, BASE_NAME, DATALINECOUNT,
         # proc = remote.run(args=['rados', '-p', POOL, 'put', NAME, DDNAME])
         ret = proc.wait()
         if ret != 0:
-            log.critical("Rados put failed with status {ret}".format(ret=r[0].exitstatus))
+            log.critical("Rados put failed with status {ret}".format(ret=proc.exitstatus))
             sys.exit(1)
 
         db[NAME] = {}
@@ -151,18 +150,6 @@ def task(ctx, config):
         config = {}
     assert isinstance(config, dict), \
         'ceph_objectstore_tool task only accepts a dict for configuration'
-    #TEUTHDIR = teuthology.get_testdir(ctx)
-
-    # clients = config['clients']
-    # assert len(clients) > 0,
-    #    'ceph_objectstore_tool task needs at least 1 client'
-
-    #ERRORS = 0
-    #DATADIR = os.path.join(TEUTHDIR, "data")
-    # Put a test dir below the data dir
-    # TESTDIR = os.path.join(DATADIR, "test")
-    #DATALINECOUNT = 10000
-    # PROFNAME = "testecprofile"
 
     log.info('Beginning ceph_objectstore_tool...')
 
@@ -211,7 +198,7 @@ def task(ctx, config):
     EC_POOL = "ec_pool"
     EC_NAME = "ECobject"
     create_ec_pool(cli_remote, EC_POOL, 'default', PGNUM)
-    ERRORS += test_objectstore(ctx, config, cli_remote, EC_POOL, EC_NAME, ec = True)
+    ERRORS += test_objectstore(ctx, config, cli_remote, EC_POOL, EC_NAME, ec=True)
 
     if ERRORS == 0:
         log.info("TEST PASSED")
@@ -226,7 +213,7 @@ def task(ctx, config):
         log.info('Ending ceph_objectstore_tool')
 
 
-def test_objectstore(ctx, config, cli_remote, REP_POOL, REP_NAME, ec = False):
+def test_objectstore(ctx, config, cli_remote, REP_POOL, REP_NAME, ec=False):
     manager = ctx.manager
 
     osds = ctx.cluster.only(teuthology.is_type('osd'))
@@ -601,9 +588,9 @@ def test_objectstore(ctx, config, cli_remote, REP_POOL, REP_NAME, ec = False):
 
             ret = proc.wait()
             if ret != 0:
-               log.errors("After import, rados get failed with {ret}".format(ret=r[0].exitstatus))
-               ERRORS += 1
-               continue
+                log.errors("After import, rados get failed with {ret}".format(ret=proc.exitstatus))
+                ERRORS += 1
+                continue
 
             cmd = "diff -q {gettest} {ref}".format(gettest=TESTNAME, ref=REFNAME)
             proc = cli_remote.run(args=cmd, check_status=False)