From 1fb599d952a85dca6db2de9d2cbd45a7a9cd54c2 Mon Sep 17 00:00:00 2001 From: Anton Chernykh Date: Mon, 20 Feb 2017 16:39:02 +0300 Subject: [PATCH 1/2] check enviroment for https_proxy --- yandextank/plugins/Overload/client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yandextank/plugins/Overload/client.py b/yandextank/plugins/Overload/client.py index 42abfe4..14115b8 100644 --- a/yandextank/plugins/Overload/client.py +++ b/yandextank/plugins/Overload/client.py @@ -19,6 +19,11 @@ class OverloadClient(object): self.session = requests.Session() self.session.verify = False self.session.headers.update({"User-Agent": "tank"}) + if "https" in requests.utils.getproxies(): + logger.info("Connecting via proxy %s" % requests.utils.getproxies()['https']) + self.session.proxies = requests.utils.getproxies() + else: + logger.info("Proxy not set") def set_api_address(self, addr): self.address = addr From f02c1fad54731bdc3e2c79fa865991e62fe4aea4 Mon Sep 17 00:00:00 2001 From: Anton Chernykh Date: Mon, 20 Feb 2017 18:02:07 +0300 Subject: [PATCH 2/2] fix ident --- yandextank/plugins/Overload/client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yandextank/plugins/Overload/client.py b/yandextank/plugins/Overload/client.py index 14115b8..5c4a76c 100644 --- a/yandextank/plugins/Overload/client.py +++ b/yandextank/plugins/Overload/client.py @@ -20,10 +20,10 @@ class OverloadClient(object): self.session.verify = False self.session.headers.update({"User-Agent": "tank"}) if "https" in requests.utils.getproxies(): - logger.info("Connecting via proxy %s" % requests.utils.getproxies()['https']) - self.session.proxies = requests.utils.getproxies() + logger.info("Connecting via proxy %s" % requests.utils.getproxies()['https']) + self.session.proxies = requests.utils.getproxies() else: - logger.info("Proxy not set") + logger.info("Proxy not set") def set_api_address(self, addr): self.address = addr