Use stdlib urlparse
The wrapper swift wrote for IPv6 support hasn't been necessary since dropping support for Python 2.6 back in 2015. See - https://github.com/openstack/swift/commit/67de0c8 - https://github.com/python/cpython/commit/8c6d9d7 - https://bugs.python.org/issue2987 Drive-by: use range() since xrange() doesn't exist on py3 and we're only going to 16; clean up an invalid escape sequence. Change-Id: Ib124cb27edd4c3defdb4a9e2404dcdcb71e6dd99
This commit is contained in:
parent
e9e8c51a92
commit
50b8688e7e
@ -20,8 +20,8 @@ from optparse import OptionParser
|
||||
from sys import argv
|
||||
from sys import exit
|
||||
|
||||
from six.moves.urllib.parse import urlparse
|
||||
from swift.common.bufferedhttp import http_connect_raw as http_connect
|
||||
from swift.common.utils import urlparse
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -20,8 +20,8 @@ from optparse import OptionParser
|
||||
from sys import argv
|
||||
from sys import exit
|
||||
|
||||
from six.moves.urllib.parse import urlparse
|
||||
from swift.common.bufferedhttp import http_connect_raw as http_connect
|
||||
from swift.common.utils import urlparse
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -99,7 +99,7 @@ if __name__ == '__main__':
|
||||
if options.verbose:
|
||||
print('Done.')
|
||||
exit(0)
|
||||
for x in xrange(16):
|
||||
for x in range(16):
|
||||
container = '.token_%x' % x
|
||||
marker = None
|
||||
while True:
|
||||
@ -132,7 +132,7 @@ if __name__ == '__main__':
|
||||
if err.http_status != 404:
|
||||
raise
|
||||
continue
|
||||
last_modified = datetime(*map(int, re.split('[^\d]',
|
||||
last_modified = datetime(*map(int, re.split(r'[^\d]',
|
||||
obj['last_modified'])[:-1]))
|
||||
ago = datetime.utcnow() - last_modified
|
||||
if ago > options.token_life:
|
||||
|
@ -20,8 +20,8 @@ from optparse import OptionParser
|
||||
from sys import argv
|
||||
from sys import exit
|
||||
|
||||
from six.moves.urllib.parse import urlparse
|
||||
from swift.common.bufferedhttp import http_connect_raw as http_connect
|
||||
from swift.common.utils import urlparse
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -20,8 +20,8 @@ from optparse import OptionParser
|
||||
from sys import argv
|
||||
from sys import exit
|
||||
|
||||
from six.moves.urllib.parse import urlparse
|
||||
from swift.common.bufferedhttp import http_connect_raw as http_connect
|
||||
from swift.common.utils import urlparse
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -21,8 +21,8 @@ from optparse import OptionParser
|
||||
from sys import argv
|
||||
from sys import exit
|
||||
|
||||
from six.moves.urllib.parse import urlparse
|
||||
from swift.common.bufferedhttp import http_connect_raw as http_connect
|
||||
from swift.common.utils import urlparse
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -20,8 +20,8 @@ from optparse import OptionParser
|
||||
from sys import argv
|
||||
from sys import exit
|
||||
|
||||
from six.moves.urllib.parse import urlparse
|
||||
from swift.common.bufferedhttp import http_connect_raw as http_connect
|
||||
from swift.common.utils import urlparse
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -21,8 +21,8 @@ from optparse import OptionParser
|
||||
from sys import argv
|
||||
from sys import exit
|
||||
|
||||
from six.moves.urllib.parse import urlparse
|
||||
from swift.common.bufferedhttp import http_connect_raw as http_connect
|
||||
from swift.common.utils import urlparse
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -21,6 +21,7 @@ from httplib import HTTPConnection
|
||||
from httplib import HTTPSConnection
|
||||
import json
|
||||
import six
|
||||
from six.moves.urllib.parse import urlparse
|
||||
import swift
|
||||
from time import gmtime
|
||||
from time import strftime
|
||||
@ -56,7 +57,6 @@ from swift.common.utils import HASH_PATH_PREFIX
|
||||
from swift.common.utils import HASH_PATH_SUFFIX
|
||||
from swift.common.utils import split_path
|
||||
from swift.common.utils import TRUE_VALUES
|
||||
from swift.common.utils import urlparse
|
||||
import swift.common.wsgi
|
||||
|
||||
import swauth.authtypes
|
||||
|
Loading…
x
Reference in New Issue
Block a user