summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Coldrick <adam.coldrick@codethink.co.uk>2014-03-17 16:19:47 +0000
committerAdam Coldrick <adam.coldrick@codethink.co.uk>2014-03-20 15:05:22 +0000
commit65c32e67eb8fcd57377fc14f4503faa700a14cb2 (patch)
treed4083ecac44151bf5d160c11aa0805e74d5cd391
parentfc7b459716167614eb494684931b12382d2853ad (diff)
downloadlorry-controller-adamcoldrick/https-fix-rebase.tar.gz
Fix the construction of https urls in confparseradamcoldrick/https-fix-rebase
-rw-r--r--lorrycontroller/confparser.py12
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):