]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
repair_test: rework indentation to make it pep8 clean
authorLoic Dachary <ldachary@redhat.com>
Fri, 21 Nov 2014 14:52:25 +0000 (15:52 +0100)
committerDavid Zafman <dzafman@redhat.com>
Tue, 13 Jan 2015 20:31:15 +0000 (12:31 -0800)
Signed-off-by: Loic Dachary <ldachary@redhat.com>
tasks/ceph_manager.py
tasks/repair_test.py

index 78c775fce84fe5191c06879d37ea21d46e9d6c8e..c013fd1d1b41c7b2b97123b85d3b13630ed28dde 100644 (file)
@@ -30,7 +30,8 @@ def write_conf(ctx, conf_path=DEFAULT_CONF_PATH):
             'sudo', 'chmod', '0755', '/etc/ceph', run.Raw('&&'),
             'sudo', 'python',
             '-c',
-            'import shutil, sys; shutil.copyfileobj(sys.stdin, file(sys.argv[1], "wb"))',
+            ('import shutil, sys; '
+             'shutil.copyfileobj(sys.stdin, file(sys.argv[1], "wb"))'),
             conf_path,
             run.Raw('&&'),
             'sudo', 'chmod', '0644', conf_path,
@@ -177,13 +178,13 @@ class Thrasher:
                           "--data-path {fpath} --journal-path {jpath} "
                           "--type keyvaluestore-dev "
                           "--log-file="
-                          "/var/log/ceph/objectstore_tool.\\$pid.log".
+                          "/var/log/ceph/objectstore_tool.\\$pid.log ".
                           format(fpath=FSPATH, jpath=JPATH))
             else:
                 prefix = ("sudo ceph-objectstore-tool "
                           "--data-path {fpath} --journal-path {jpath} "
                           "--log-file="
-                          "/var/log/ceph/objectstore_tool.\\$pid.log".
+                          "/var/log/ceph/objectstore_tool.\\$pid.log ".
                           format(fpath=FSPATH, jpath=JPATH))
             cmd = (prefix + "--op list-pgs").format(id=exp_osd)
             proc = exp_remote.run(args=cmd, wait=True,
@@ -593,6 +594,7 @@ class Thrasher:
             time.sleep(delay)
         self.all_up()
 
+
 class CephManager:
     """
     Ceph manager object.
index e4719bdaacda95062bdca0afe4de1946a116bc7b..7b22fbf53231a5632b2a3e5696e29aee0d31e9b6 100644 (file)
@@ -10,6 +10,7 @@ from teuthology import misc as teuthology
 
 log = logging.getLogger(__name__)
 
+
 def choose_primary(ctx, pool, num):
     """
     Return primary to test on.
@@ -17,6 +18,7 @@ def choose_primary(ctx, pool, num):
     log.info("Choosing primary")
     return ctx.manager.get_pg_primary(pool, num)
 
+
 def choose_replica(ctx, pool, num):
     """
     Return replica to test on.
@@ -24,6 +26,7 @@ def choose_replica(ctx, pool, num):
     log.info("Choosing replica")
     return ctx.manager.get_pg_replica(pool, num)
 
+
 def trunc(ctx, osd, pool, obj):
     """
     truncate an object
@@ -33,15 +36,17 @@ def trunc(ctx, osd, pool, obj):
         osd,
         ['truncobj', pool, obj, '1'])
 
+
 def dataerr(ctx, osd, pool, obj):
     """
-    cause an error in the data 
+    cause an error in the data
     """
     log.info("injecting data err on object")
     return ctx.manager.osd_admin_socket(
         osd,
         ['injectdataerr', pool, obj])
 
+
 def mdataerr(ctx, osd, pool, obj):
     """
     cause an error in the mdata
@@ -51,12 +56,14 @@ def mdataerr(ctx, osd, pool, obj):
         osd,
         ['injectmdataerr', pool, obj])
 
+
 def omaperr(ctx, osd, pool, obj):
     """
     Cause an omap error.
     """
     log.info("injecting omap err on object")
-    return ctx.manager.osd_admin_socket(osd, ['setomapval', pool, obj, 'badkey', 'badval']);
+    return ctx.manager.osd_admin_socket(osd, ['setomapval', pool, obj,
+                                              'badkey', 'badval'])
 
 def repair_test_1(ctx, corrupter, chooser, scrub_type):
     """
@@ -101,13 +108,14 @@ def repair_test_1(ctx, corrupter, chooser, scrub_type):
         assert not ctx.manager.pg_inconsistent(pool, 0)
         log.info("done")
 
+
 def repair_test_2(ctx, config, chooser):
     """
     First creates a set of objects and
     sets the omap value.  It then corrupts an object, does both a scrub
     and a deep-scrub, and then corrupts more objects.  After that, it
     repairs the pool and makes sure that the pool is consistent some
-    time after a deep-scrub. 
+    time after a deep-scrub.
 
     :param chooser: primary or replica selection routine.
     """
@@ -122,12 +130,14 @@ def repair_test_2(ctx, config, chooser):
         # create object
         log.info("doing put and setomapval")
         ctx.manager.do_put(pool, 'file1', '/etc/hosts')
-        ctx.manager.do_rados(mon, ['-p', pool, 'setomapval', 'file1', 'key', 'val'])
+        ctx.manager.do_rados(mon, ['-p', pool, 'setomapval', 'file1',
+                                   'key', 'val'])
         ctx.manager.do_put(pool, 'file2', '/etc/hosts')
         ctx.manager.do_put(pool, 'file3', '/etc/hosts')
         ctx.manager.do_put(pool, 'file4', '/etc/hosts')
         ctx.manager.do_put(pool, 'file5', '/etc/hosts')
-        ctx.manager.do_rados(mon, ['-p', pool, 'setomapval', 'file5', 'key', 'val'])
+        ctx.manager.do_rados(mon, ['-p', pool, 'setomapval', 'file5',
+                                   'key', 'val'])
         ctx.manager.do_put(pool, 'file6', '/etc/hosts')
 
         # corrupt object
@@ -196,7 +206,20 @@ def task(ctx, config):
     - chef:
     - install:
     - ceph:
-        log-whitelist: ['candidate had a read error', 'deep-scrub 0 missing, 1 inconsistent objects', 'deep-scrub 0 missing, 4 inconsistent objects', 'deep-scrub 1 errors', 'deep-scrub 4 errors', '!= known omap_digest', 'repair 0 missing, 1 inconsistent objects', 'repair 0 missing, 4 inconsistent objects', 'repair 1 errors, 1 fixed', 'repair 4 errors, 4 fixed', 'scrub 0 missing, 1 inconsistent', 'scrub 1 errors', 'size 1 != known size']
+        log-whitelist:
+          - 'candidate had a read error'
+          - 'deep-scrub 0 missing, 1 inconsistent objects'
+          - 'deep-scrub 0 missing, 4 inconsistent objects'
+          - 'deep-scrub 1 errors'
+          - 'deep-scrub 4 errors'
+          - '!= known omap_digest'
+          - 'repair 0 missing, 1 inconsistent objects'
+          - 'repair 0 missing, 4 inconsistent objects'
+          - 'repair 1 errors, 1 fixed'
+          - 'repair 4 errors, 4 fixed'
+          - 'scrub 0 missing, 1 inconsistent'
+          - 'scrub 1 errors'
+          - 'size 1 != known size'
         conf:
           osd:
             filestore debug inject read err: true