]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rbd: handle exception thrown from close during lock test 8124/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 15 Mar 2016 13:57:37 +0000 (09:57 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 15 Mar 2016 13:59:13 +0000 (09:59 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/test/librbd/rbdrw.py [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 6034ad0..7179551
@@ -18,14 +18,13 @@ import rados, rbd, sys
 
 with rados.Rados(conffile='') as r:
     with r.open_ioctx('rbd') as ioctx:
-        with rbd.Image(ioctx, sys.argv[1]) as image:
-            image.lock_exclusive(sys.argv[2])
-            while True:
-                try:
+        try:
+            with rbd.Image(ioctx, sys.argv[1]) as image:
+                image.lock_exclusive(sys.argv[2])
+                while True:
                     image.write('A' * 4096, 0)
                     r = image.read(0, 4096)
-                except rbd.ConnectionShutdown:
-                    # it so happens that the errno here is 108, but
-                    # anything recognizable would do
-                    exit(108)
-
+        except rbd.ConnectionShutdown:
+            # it so happens that the errno here is 108, but
+            # anything recognizable would do
+            exit(108)