Lines Matching full:location
70 @@ -28,7 +30,7 @@ is_url = lambda location: '://' in location # RFC 3986
74 -def load_to_str(location):
75 +def load_to_str(location, user=None, passwd=None):
79 @@ -39,7 +41,7 @@ def load_to_str(location):
82 if is_url(location):
83 - return _load_url(location)
84 + return _load_url(location, user=user, passwd=passwd)
86 return _load_file(location)
88 @@ -69,11 +71,31 @@ def load_to_file(location, destination):
89 _copy_file(location, destination)
92 -def _load_url(location):
93 +def _get_auth(location, user=None, passwd=None):
96 + request = requests.get(location, verify=SSL_VERIFY)
112 +def _load_url(location, user=None, passwd=None):
113 '''Load a location (URL or filename) and return contents as string'''
114 + auth = _get_auth(location, user=user, passwd=passwd)
117 - request = requests.get(location, verify=SSL_VERIFY)
118 + request = requests.get(location, verify=SSL_VERIFY, auth=auth)
120 … raise KickstartError(_('Error securely accessing URL "%s"') % location + ': {e}'.format(e=str(e)))