Compare commits

...

2 Commits

Author SHA1 Message Date
Matt Martz 6367c699de
Set fact for proxy.py pid 4 weeks ago
Matt Martz c206d4f335
Derive with improvements instead of straight copy
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
4 weeks ago

@ -303,17 +303,15 @@ class UnixHTTPHandler(urllib.request.HTTPHandler):
class ProxyHandler(urllib.request.ProxyHandler):
_SPLITPORT_RE = re.compile('(.*):([0-9]*)', re.DOTALL)
_SPLITPORT_RE = re.compile('(.*):([0-9]{1,5})', re.DOTALL)
@classmethod
def _splitport(cls, host):
# Copied from cpython urllib.parse
match = cls._SPLITPORT_RE.fullmatch(host)
if match:
# Derived from cpython urllib.parse
port = None
if (match := cls._SPLITPORT_RE.fullmatch(host)):
host, port = match.groups()
if port:
return host, port
return host, None
return host, port or None
@staticmethod
def _matches(host, port, bypass_network, bypass_port, scheme):

@ -1,2 +1,2 @@
- name: stop proxy.py
command: kill {{ proxy_py_pid.content|b64decode }}
command: kill {{ proxy_py_pid }}

@ -32,7 +32,11 @@
- name: get proxy.py pid
slurp:
path: '{{ remote_tmp_dir }}/proxy_py/proxy_py.pid'
register: proxy_py_pid
register: proxy_py_slurp_pid
- name: set fact for proxy.py pid
set_fact:
proxy_py_pid: '{{ proxy_py_slurp_pid.content|b64decode }}'
- name: set fact for proxy host
set_fact:

Loading…
Cancel
Save