diff --git a/test/functional/__init__.py b/test/functional/__init__.py index fb9f42124c..c7f7711ad8 100644 --- a/test/functional/__init__.py +++ b/test/functional/__init__.py @@ -347,7 +347,13 @@ def get_cluster_info(): # test.conf data pass else: - eff_constraints.update(cluster_info.get('swift', {})) + try: + eff_constraints.update(cluster_info['swift']) + except KeyError: + # Most likely the swift cluster has "expose_info = false" set + # in its proxy-server.conf file, so we'll just do the best we + # can. + print >>sys.stderr, "** Swift Cluster not exposing /info **" # Finally, we'll allow any constraint present in the swift-constraints # section of test.conf to override everything. Note that only those diff --git a/test/functional/test_object.py b/test/functional/test_object.py index cbdca86e49..6b29800515 100755 --- a/test/functional/test_object.py +++ b/test/functional/test_object.py @@ -916,6 +916,11 @@ class TestObject(unittest.TestCase): if tf.skip: raise SkipTest + try: + strict_cors = tf.cluster_info['swift']['strict_cors_mode'] + except KeyError: + raise SkipTest("cors mode is unknown") + def put_cors_cont(url, token, parsed, conn, orig): conn.request( 'PUT', '%s/%s' % (parsed.path, self.container), @@ -989,11 +994,6 @@ class TestObject(unittest.TestCase): resp.read() self.assertEquals(resp.status, 401) - try: - strict_cors = tf.cluster_info['swift']['strict_cors_mode'] - except KeyError: - strict_cors = False - if strict_cors: resp = retry(check_cors, 'GET', 'cat', {'Origin': 'http://m.com'})