]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rados: use backwards compatible args
authorJosh Durgin <josh.durgin@inktank.com>
Fri, 7 Mar 2014 01:31:07 +0000 (17:31 -0800)
committerJosh Durgin <josh.durgin@inktank.com>
Fri, 7 Mar 2014 01:32:10 +0000 (17:32 -0800)
For ops that default to 0, only add arguments for them if they are
specified in the task config. This lets us use the same task across
ceph versions, even if the older version does not support new op
types, like append on dumpling.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
teuthology/task/rados.py

index e1df679c6a5acd188a9777e3345605195a6a2f36..0897726a6bcf9f81437347b82bce95ce4ac1abda 100644 (file)
@@ -97,13 +97,6 @@ def task(ctx, config):
         '--op', 'read', str(op_weights.get('read', 100)),
         '--op', 'write', str(op_weights.get('write', 100)),
         '--op', 'delete', str(op_weights.get('delete', 10)),
-        '--op', 'snap_create', str(op_weights.get('snap_create', 0)),
-        '--op', 'snap_remove', str(op_weights.get('snap_remove', 0)),
-        '--op', 'rollback', str(op_weights.get('rollback', 0)),
-        '--op', 'setattr', str(op_weights.get('setattr', 0)),
-        '--op', 'rmattr', str(op_weights.get('rmattr', 0)),
-        '--op', 'watch', str(op_weights.get('watch', 0)),
-        '--op', 'append', str(op_weights.get('append', 0)),
         '--max-ops', str(config.get('ops', 10000)),
         '--objects', str(config.get('objects', 500)),
         '--max-in-flight', str(config.get('max_in_flight', 16)),
@@ -115,10 +108,12 @@ def task(ctx, config):
     for field in [
         'copy_from', 'is_dirty', 'undirty', 'cache_flush',
         'cache_try_flush', 'cache_evict',
+        'snap_create', 'snap_remove', 'rollback', 'setattr', 'rmattr',
+        'watch', 'append',
         ]:
         if field in op_weights:
             args.extend([
-                    '--op', field, str(op_weights.get(field, 0))
+                    '--op', field, str(op_weights[field]),
                     ])
 
     def thread():