Skip to content

Commit 8170d72

Browse files
creihtTarmac
authored and
Tarmac
committed
Changed the auth code to use a default port of 80 if the port is not specified in default_storage_url
2 parents 9b299b9 + db072cb commit 8170d72

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

swift/auth/server.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,11 @@ def add_storage_account(self, account_name=''):
197197
(?, ?, '.super_admin', '.single_use', '.reseller_admin')''',
198198
(token, time()))
199199
conn.commit()
200-
conn = http_connect(parsed.hostname, parsed.port, 'PUT', parsed.path,
200+
if parsed.port is None:
201+
port = {'http': 80, 'https': 443}.get(parsed.scheme, 80)
202+
else:
203+
port = parsed.port
204+
conn = http_connect(parsed.hostname, port, 'PUT', parsed.path,
201205
{'X-Auth-Token': token}, ssl=(parsed.scheme == 'https'))
202206
resp = conn.getresponse()
203207
resp.read()

0 commit comments

Comments
 (0)