Fix to not require explicit port specification in REST_API_URL.

This commit is contained in:
Chris Church
2013-06-28 05:54:05 -04:00
parent ffa48f2c9e
commit 395685b23b
2 changed files with 4 additions and 2 deletions

View File

@@ -93,8 +93,9 @@ class CallbackModule(object):
auth = TokenAuth(self.auth_token)
else:
auth = None
port = parts.port or (443 if parts.scheme == 'https' else 80)
url = urlparse.urlunsplit([parts.scheme,
'%s:%d' % (parts.hostname, parts.port),
'%s:%d' % (parts.hostname, port),
parts.path, parts.query, parts.fragment])
url_path = '/api/v1/jobs/%d/job_events/' % self.job_id
url = urlparse.urljoin(url, url_path)

View File

@@ -71,8 +71,9 @@ class InventoryScript(object):
auth = TokenAuth(self.auth_token)
else:
auth = None
port = parts.port or (443 if parts.scheme == 'https' else 80)
url = urlparse.urlunsplit([parts.scheme,
'%s:%d' % (parts.hostname, parts.port),
'%s:%d' % (parts.hostname, port),
parts.path, parts.query, parts.fragment])
url_path = '/api/v1/inventories/%d/script/' % self.inventory_id
if self.hostname: