]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
boto3: _get_post_url() uses config endpoint
authorCasey Bodley <cbodley@redhat.com>
Tue, 26 Feb 2019 21:25:28 +0000 (16:25 -0500)
committerCasey Bodley <cbodley@redhat.com>
Wed, 27 Feb 2019 16:44:27 +0000 (11:44 -0500)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
s3tests_boto3/functional/__init__.py
s3tests_boto3/functional/test_s3.py

index 54bf0d17fa08b4d053f1e35e2cbff4aed0ea28b3..78109ac2adfe4991266db83f8cf3b6d02c39db04 100644 (file)
@@ -339,6 +339,9 @@ def get_config_host():
 def get_config_port():
     return config.default_port
 
+def get_config_endpoint():
+    return config.default_endpoint
+
 def get_main_aws_access_key():
     return config.main_access_key
 
index 13fb30077fa76976046d63572c882a4e704d2708..3038a846ac9ed0f52e717fbe06d7ae559bfa1368 100644 (file)
@@ -50,6 +50,7 @@ from . import (
     get_config_is_secure,
     get_config_host,
     get_config_port,
+    get_config_endpoint,
     get_main_aws_access_key,
     get_main_aws_secret_key,
     get_main_display_name,
@@ -1360,18 +1361,8 @@ def test_object_write_file():
     eq(body, 'bar')
 
 def _get_post_url(bucket_name):
-    protocol='http'
-    is_secure = get_config_is_secure()
-
-    if is_secure is True:
-        protocol='https'
-
-    host = get_config_host()
-    port = get_config_port()
-
-    url = '{protocol}://{host}:{port}/{bucket_name}'.format(protocol=protocol,\
-                host=host, port=port, bucket_name=bucket_name)
-    return url
+    endpoint = get_config_endpoint()
+    return '{endpoint}/{bucket_name}'.format(endpoint=endpoint, bucket_name=bucket_name)
 
 @attr(resource='object')
 @attr(method='post')