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-20 15:05:22 +0000 |
commit | 65c32e67eb8fcd57377fc14f4503faa700a14cb2 (patch) | |
tree | d4083ecac44151bf5d160c11aa0805e74d5cd391 | |
parent | fc7b459716167614eb494684931b12382d2853ad (diff) | |
download | lorry-controller-65c32e67eb8fcd57377fc14f4503faa700a14cb2.tar.gz |
Fix the construction of https urls in confparseradamcoldrick/https-fix-rebase
-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): |