diff options
author | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2014-03-17 16:19:47 +0000 |
---|---|---|
committer | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2014-03-17 16:19:47 +0000 |
commit | 13f45d374b52a449a56f4ccf669c6466a56c2c20 (patch) | |
tree | c53e92ddc417a369428bf87d36de6fbd6c209dd8 | |
parent | 0a0b829261ec572fa8c254fa625b38b7d504a60d (diff) | |
download | lorry-controller-13f45d374b52a449a56f4ccf669c6466a56c2c20.tar.gz |
Fix the construction of https urls in confparser
-rw-r--r-- | lorrycontroller/confparser.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lorrycontroller/confparser.py b/lorrycontroller/confparser.py index e8b78d8..403b768 100644 --- a/lorrycontroller/confparser.py +++ b/lorrycontroller/confparser.py @@ -323,15 +323,11 @@ class LorryControllerConfig(object): query_string = '%s %s' % (command, ' '.join(args)) query_string = urllib.quote(query_string) trovehost = urllib.quote(trove['trovehost']) - url = '%s/gitano-command.cgi?cmd=%s' % (trovehost, query_string) - if trove['protocol'] == 'https': - url = ('https://%s:%s@%s' % (trove['auth']['username'], - trove['auth']['password'], - url)) - else: - url = 'http://%s' % url + url = '%s://%s/gitano-command.cgi?cmd=%s' % ( + trove['protocol'], trovehost, query_string) + auth = trove.get('auth', None) # make an http request to the url - exit, out, err = self.app.maybe_http_request(url, dry=dry) + exit, out, err = self.app.maybe_http_request(url, auth=auth, dry=dry) return exit, out, err def _give_up(self, *args, **kwargs): |