From 9ee6452404a750511313f6010ddf08a2e8e59782 Mon Sep 17 00:00:00 2001 From: Joe Buck Date: Thu, 8 Aug 2013 21:03:27 -0700 Subject: [PATCH] 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 --- teuthology/task/rgw.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/teuthology/task/rgw.py b/teuthology/task/rgw.py index ff41f4244a..3b05678d16 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) -- 2.39.5