From 65c32e67eb8fcd57377fc14f4503faa700a14cb2 Mon Sep 17 00:00:00 2001 From: Adam Coldrick Date: Mon, 17 Mar 2014 16:19:47 +0000 Subject: Fix the construction of https urls in confparser --- lorrycontroller/confparser.py | 12 ++++-------- 1 file 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): -- cgit v1.2.1