]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
website: Support both NoSuchWebsiteConfiguration and NoSuchKey for fetching the websi...
authorRobin H. Johnson <robbat2@gentoo.org>
Fri, 29 Jan 2016 04:01:45 +0000 (04:01 +0000)
committerRobin H. Johnson <robin.johnson@dreamhost.com>
Wed, 20 Apr 2016 23:08:57 +0000 (16:08 -0700)
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
s3tests/functional/test_s3_website.py

index 8efd0241cdf76be53b520c690180fe9971e0cbb2..9fb47ae05958024536bc493eecf461042d5a2030 100644 (file)
@@ -49,7 +49,7 @@ def check_can_test_website():
             wsconf = bucket.get_website_configuration()
             CAN_WEBSITE = True
         except boto.exception.S3ResponseError as e:
-            if e.status == 404 and e.reason == 'Not Found' and e.error_code ==  'NoSuchWebsiteConfiguration':
+            if e.status == 404 and e.reason == 'Not Found' and e.error_code in ['NoSuchWebsiteConfiguration', 'NoSuchKey']:
                 CAN_WEBSITE = True
             elif e.status == 405 and e.reason == 'Method Not Allowed' and e.error_code == 'MethodNotAllowed':
                 # rgw_enable_static_website is false
@@ -132,8 +132,8 @@ def _test_website_prep(bucket, xml_template, hardcoded_fields = {}, expect_fail=
         config_xmlold = common.normalize_xml(bucket.get_website_configuration_xml(), pretty_print=True)
     except boto.exception.S3ResponseError as e:
         if str(e.status) == str(404) \
-            and True:
-            #and ('NoSuchWebsiteConfiguration' in e.body or 'NoSuchWebsiteConfiguration' in e.code):
+            and ('NoSuchWebsiteConfiguration' in e.body or 'NoSuchWebsiteConfiguration' in e.code or
+                    'NoSuchKey' in e.body or 'NoSuchKey' in e.code):
             pass
         else:
             raise e