]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Wait for rbd devices to be removed before removing the module.
authorJosh Durgin <josh.durgin@dreamhost.com>
Thu, 23 Jun 2011 00:32:10 +0000 (17:32 -0700)
committerJosh Durgin <josh.durgin@dreamhost.com>
Thu, 23 Jun 2011 00:32:10 +0000 (17:32 -0700)
teuthology/task/rbd.py

index c288821d5743c824fb781e83bfa41c4bf39d8cf0..66500c03f333333212b3b7b25fa77281ea8b82bc 100644 (file)
@@ -201,6 +201,13 @@ def dev_create(ctx, config):
                     '-p', 'rbd',
                     'unmap',
                     '/dev/rbd/rbd/{imgname}'.format(imgname=image),
+                    run.Raw('&&'),
+                    # wait for the symlink to be deleted by udev
+                    'while', 'test', '-e', '/dev/rbd/rbd/{image}'.format(image=image),
+                    run.Raw(';'),
+                    'do',
+                    'sleep', '1', run.Raw(';'),
+                    'done',
                     ],
                 )
             remote.run(