diff --git a/kong/common/http.py b/kong/common/http.py index 47ac058b7d..d7f4a48f35 100644 --- a/kong/common/http.py +++ b/kong/common/http.py @@ -14,7 +14,6 @@ class Client(object): self.base_url = "http://%s:%s/%s" % (host, port, base_url) def poll_request(self, method, url, check_response, **kwargs): - timeout = kwargs.pop('timeout', 180) interval = kwargs.pop('interval', 2) # Start timestamp @@ -29,15 +28,13 @@ class Client(object): time.sleep(interval) def poll_request_status(self, method, url, status=200, **kwargs): - def check_response(resp, body): return resp['status'] == str(status) self.poll_request(method, url, check_response, **kwargs) - def request(self, method, url, **kwargs): - # Default to management_url, but can be overridden here + # Default to management_url, but can be overridden here # (for auth requests) base_url = kwargs.get('base_url', self.management_url) diff --git a/kong/nova.py b/kong/nova.py index 41b4b4e522..bb40d59e3c 100644 --- a/kong/nova.py +++ b/kong/nova.py @@ -1,6 +1,4 @@ import json -import logging -import subprocess import kong.common.http from kong import exceptions @@ -24,7 +22,7 @@ class API(kong.common.http.Client): self.user = user self.api_key = api_key self.project_id = project_id - # Default to same as base_url, but will be change on auth + # Default to same as base_url, but will be changed for auth self.management_url = self.base_url def authenticate(self, user, api_key, project_id): @@ -104,7 +102,7 @@ class API(kong.common.http.Client): project_id = kwargs.get('project_id', self.project_id) headers['X-Auth-Token'] = self.authenticate(self.user, self.api_key, - self.project_id) + project_id) kwargs['headers'] = headers return super(API, self).request(method, url, **kwargs) diff --git a/kong/run_tests.py b/kong/run_tests.py index 091dce487f..57a82531ea 100644 --- a/kong/run_tests.py +++ b/kong/run_tests.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 -import gettext import heapq import os import unittest diff --git a/kong/tests/test_images.py b/kong/tests/test_images.py index 0a9b682cfd..e0e22fafd6 100644 --- a/kong/tests/test_images.py +++ b/kong/tests/test_images.py @@ -89,7 +89,7 @@ class TestGlanceAPI(tests.FunctionalTest): def setUp(self): super(TestGlanceAPI, self).setUp() self.base_url = "http://%s:%s/%s/images" % (self.glance['host'], - self.glance['port'], + self.glance['port'], self.glance['apiver']) def test_upload_ami_style_image(self):