mirror of
https://github.com/ansible/awx.git
synced 2026-08-05 20:40:01 -02:30
Merge branch 'release_3.1.2' into devel
* release_3.1.2: (33 commits) updating changelog for 3.1.2 Add back SRC_ONLY_PKGS Fix ubuntu 14 restart service list pt 2 Make sure the insight playbook fetch doesn't quote user and pass Add requirements/vendor to gitignore Conditionally install from local python dependencies in spec file Remove requirements/vendor on make clean. Update brew-srpm target to generate local requirements files Get offline pip installs working Add clean-dist target Navigate back to the jobDetails state when the user clicks outside the host event modal. Don't use jinja quote filter on insights username or password fix legacy standard out Fixed permissions typo add test, restore old behavior in api test create _survey_element_validation and use it for updating extra_vars Do not set the default if the field was not passed in to kwargs_extra_vars Remove log aggregator port required mark. Modify according to review feedback. Host Event json should be read-only ...
This commit is contained in:
@@ -6,6 +6,7 @@ import logging
|
||||
import json
|
||||
import requests
|
||||
import time
|
||||
import urlparse
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from copy import copy
|
||||
from requests.exceptions import RequestException
|
||||
@@ -148,10 +149,21 @@ class BaseHTTPSHandler(logging.Handler):
|
||||
|
||||
def get_http_host(self):
|
||||
host = self.host or ''
|
||||
if not host.startswith('http'):
|
||||
host = 'http://%s' % self.host
|
||||
if self.port != 80 and self.port is not None:
|
||||
host = '%s:%s' % (host, str(self.port))
|
||||
# urlparse requires scheme to be provided, default to use http if
|
||||
# missing
|
||||
if not urlparse.urlsplit(host).scheme:
|
||||
host = 'http://%s' % host
|
||||
parsed = urlparse.urlsplit(host)
|
||||
# Insert self.port if its special and port number is either not
|
||||
# given in host or given as non-numerical
|
||||
try:
|
||||
port = parsed.port or self.port
|
||||
except ValueError:
|
||||
port = self.port
|
||||
if port not in (80, None):
|
||||
new_netloc = '%s:%s' % (parsed.hostname, port)
|
||||
return urlparse.urlunsplit((parsed.scheme, new_netloc, parsed.path,
|
||||
parsed.query, parsed.fragment))
|
||||
return host
|
||||
|
||||
def get_post_kwargs(self, payload_input):
|
||||
|
||||
Reference in New Issue
Block a user