From: Joe Buck Date: Fri, 9 Aug 2013 04:03:27 +0000 (-0700) Subject: rgw.py: add a better error message X-Git-Tag: 1.1.0~1982^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9ee6452404a750511313f6010ddf08a2e8e59782;p=teuthology.git rgw.py: add a better error message When pulling region info from the config structure, if the region info isn't there, log a more helpful message. Signed-off-by: Joe Buck --- diff --git a/teuthology/task/rgw.py b/teuthology/task/rgw.py index ff41f4244..3b05678d1 100644 --- a/teuthology/task/rgw.py +++ b/teuthology/task/rgw.py @@ -333,6 +333,13 @@ def fill_in_endpoints(region_info, role_zones, role_endpoints): region, zone, zone_info, _ = role_zones[role] host, port = role_endpoints[role] endpoint = 'http://{host}:{port}/'.format(host=host, port=port) + # check if the region specified under client actually exists + # in region_info (it should, if properly configured). + # If not, throw a reasonable error + if region not in region_info: + raise Exception('Region: {region} was specified but no corresponding' \ + ' entry was round under \'regions\''.format(region=region)) + region_conf = region_info[region] region_conf.setdefault('endpoints', []) region_conf['endpoints'].append(endpoint)