From: Warren Usui Date: Sat, 1 Mar 2014 03:13:40 +0000 (-0800) Subject: Lines formerly of the form '(remote,) = ctx.cluster.only(role).remotes.keys()' X-Git-Tag: v10.2.8~13^2~2^2~4^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e98b107302e06fa5c3c628a7ab0e7455de9ab568;p=ceph.git Lines formerly of the form '(remote,) = ctx.cluster.only(role).remotes.keys()' and '(remote,) = ctx.cluster.only(role).remotes.iterkeys()' would fail with ValueError and no message if there were less than 0 or more than 1 key. Now a new function, get_single_remote_value() is called which prints out more understandable messages. Fixes: 7510 Reviewed-by: Josh Durgin Signed-off-by: Warren Usui --- diff --git a/s3tests.py b/s3tests.py index abbacb9bfaa3..f2c2b0728486 100644 --- a/s3tests.py +++ b/s3tests.py @@ -246,7 +246,7 @@ def configure(ctx, config): else: s3tests_conf['DEFAULT']['host'] = 'localhost' - (remote,) = ctx.cluster.only(client).remotes.keys() + remote = teuthology.get_single_remote_value(ctx, client) remote.run( args=[ 'cd', diff --git a/swift.py b/swift.py index 6285eb6b1c51..efc858776592 100644 --- a/swift.py +++ b/swift.py @@ -133,7 +133,7 @@ def configure(ctx, config): testswift_conf['func_test']['auth_host'] = 'localhost' log.info(client) - (remote,) = ctx.cluster.only(client).remotes.keys() + remote = teuthology.get_single_remote_value(ctx, client) remote.run( args=[ 'cd',