[s3_bucket] import urlparse (#42474)

Fixes #42459

(cherry picked from commit 7086863c52)
pull/42737/merge
Sloane Hertel 6 years ago committed by Matt Clay
parent 8274fd00fc
commit 880f1d1817

@ -108,7 +108,7 @@ import json
import os import os
import time import time
import ansible.module_utils.six.moves.urllib.parse as urlparse from ansible.module_utils.six.moves.urllib.parse import urlparse
from ansible.module_utils.six import string_types from ansible.module_utils.six import string_types
from ansible.module_utils.basic import to_text from ansible.module_utils.basic import to_text
from ansible.module_utils.aws.core import AnsibleAWSModule from ansible.module_utils.aws.core import AnsibleAWSModule
@ -455,7 +455,7 @@ def destroy_bucket(s3_client, module):
def is_fakes3(s3_url): def is_fakes3(s3_url):
""" Return True if s3_url has scheme fakes3:// """ """ Return True if s3_url has scheme fakes3:// """
if s3_url is not None: if s3_url is not None:
return urlparse.urlparse(s3_url).scheme in ('fakes3', 'fakes3s') return urlparse(s3_url).scheme in ('fakes3', 'fakes3s')
else: else:
return False return False
@ -465,7 +465,7 @@ def is_walrus(s3_url):
We assume anything other than *.amazonaws.com is Walrus""" We assume anything other than *.amazonaws.com is Walrus"""
if s3_url is not None: if s3_url is not None:
o = urlparse.urlparse(s3_url) o = urlparse(s3_url)
return not o.hostname.endswith('amazonaws.com') return not o.hostname.endswith('amazonaws.com')
else: else:
return False return False

Loading…
Cancel
Save