]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Add a retry to the rbd volume verification
authorZack Cerza <zack@cerza.org>
Thu, 20 Feb 2014 17:14:55 +0000 (11:14 -0600)
committerZack Cerza <zack@cerza.org>
Thu, 20 Feb 2014 23:46:09 +0000 (17:46 -0600)
This was running into an auth problem intermittently that Josh Durgin
said is likely not a real problem. Still, try the original call first
and fall back to a different one if it fails.

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/task/devstack.py

index 1e6033c31965cbe02f36d033a6d9ff466742f1f8..e3932d9b0f84d236a42c679cc2a67a31f97d069f 100644 (file)
@@ -356,10 +356,17 @@ def create_volume(devstack_node, ceph_node, vol_name, size):
     out_stream = StringIO()
     devstack_node.run(args=args, stdout=out_stream, wait=True)
     vol_info = parse_os_table(out_stream.getvalue())
+    log.debug("Volume info: %s", str(vol_info))
 
     out_stream = StringIO()
-    ceph_node.run(args="rbd --id cinder ls -l volumes", stdout=out_stream,
-                  wait=True)
+    try:
+        ceph_node.run(args="rbd --id cinder ls -l volumes", stdout=out_stream,
+                      wait=True)
+    except run.CommandFailedError:
+        log.debug("Original rbd call failed; retrying without '--id cinder'")
+        ceph_node.run(args="rbd ls -l volumes", stdout=out_stream,
+                      wait=True)
+
     assert vol_info['id'] in out_stream.getvalue()
     assert vol_info['size'] == size
     return vol_info['id']