]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: only specify --format if not using the default
authorJosh Durgin <josh.durgin@inktank.com>
Wed, 12 Sep 2012 18:30:40 +0000 (11:30 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Wed, 12 Sep 2012 18:31:28 +0000 (11:31 -0700)
This lets older versions that do not support --format still work with
format 1 images.

teuthology/task/rbd.py

index 625d623672cfbcab8a508b2cb3d4959bf284f465..56b851962440eb3f5d79f5851410cc90789dbc3a 100644 (file)
@@ -51,9 +51,8 @@ def create_image(ctx, config):
         (remote,) = ctx.cluster.only(role).remotes.keys()
         log.info('Creating image {name} with size {size}'.format(name=name,
                                                                  size=size))
-        remote.run(
-            args=[
-                'LD_LIBRARY_PATH=/tmp/cephtest/binary/usr/local/lib',
+        args = [
+            'LD_LIBRARY_PATH=/tmp/cephtest/binary/usr/local/lib',
                 '/tmp/cephtest/enable-coredump',
                 '/tmp/cephtest/binary/usr/local/bin/ceph-coverage',
                 '/tmp/cephtest/archive/coverage',
@@ -61,11 +60,14 @@ def create_image(ctx, config):
                 '-c', '/tmp/cephtest/ceph.conf',
                 '-p', 'rbd',
                 'create',
-                '--format', str(fmt),
                 '--size', str(size),
                 name,
-                ],
-            )
+            ]
+        # omit format option if using the default (format 1)
+        # since old versions of don't support it
+        if format != 1:
+            args += ['--format', str(fmt)]
+        remote.run(args=args)
     try:
         yield
     finally: