]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
rgw.py: add a better error message
authorJoe Buck <jbbuck@gmail.com>
Fri, 9 Aug 2013 04:03:27 +0000 (21:03 -0700)
committerJoe Buck <jbbuck@gmail.com>
Tue, 13 Aug 2013 06:25:33 +0000 (23:25 -0700)
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 <jbbuck@gmail.com>
teuthology/task/rgw.py

index ff41f4244ac3fb6188fe141c7903d8e819c9af67..3b05678d16c21e90760c7eefd3922e3550c71887 100644 (file)
@@ -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)