From 741b4de337435d5976712fde68490dfbdabc1392 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Thu, 20 Feb 2014 11:14:55 -0600 Subject: [PATCH] Add a retry to the rbd volume verification 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 --- teuthology/task/devstack.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/teuthology/task/devstack.py b/teuthology/task/devstack.py index 1e6033c319..e3932d9b0f 100644 --- a/teuthology/task/devstack.py +++ b/teuthology/task/devstack.py @@ -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'] -- 2.39.5