]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: fix rbd image unmount
authorSage Weil <sage@inktank.com>
Wed, 6 Feb 2013 07:19:23 +0000 (23:19 -0800)
committerSage Weil <sage@inktank.com>
Wed, 6 Feb 2013 07:19:23 +0000 (23:19 -0800)
The testdir param was missing.  Avoid this class of errors by unmounting
exactly what we mounted.

teuthology/task/rbd.py

index 39dc56601d008f4bb6854e86b61bf9c04bd311d4..1f86d7d8ba0e3b195933d72617f5a03c07eba9aa 100644 (file)
@@ -318,12 +318,14 @@ def mount(ctx, config):
     testdir = teuthology.get_testdir(ctx)
 
     mnt_template = '{tdir}/mnt.{id}'
+    mounted = []
     for role, image in role_images:
         if image is None:
             image = default_image_name(role)
         (remote,) = ctx.cluster.only(role).remotes.keys()
         id_ = strip_client_prefix(role)
         mnt = mnt_template.format(tdir=testdir, id=id_)
+        mounted.append((remote, mnt))
         remote.run(
             args=[
                 'mkdir',
@@ -344,13 +346,8 @@ def mount(ctx, config):
     try:
         yield
     finally:
-        log.info("Unmounting rbd images...")
-        for role, image in role_images:
-            if image is None:
-                image = default_image_name(role)
-            (remote,) = ctx.cluster.only(role).remotes.keys()
-            id_ = strip_client_prefix(role)
-            mnt = mnt_template.format(id=id_)
+        log.info("Unmounting rbd images... %s", mounted)
+        for remote, mnt in mounted:
             remote.run(
                 args=[
                     'sudo',
@@ -358,7 +355,6 @@ def mount(ctx, config):
                     mnt,
                     ],
                 )
-
             remote.run(
                 args=[
                     'rmdir',