Commit 20e48482 authored by ale's avatar ale
Browse files

Update the python3.7 patch

parent 794e1085
Pipeline #7460 passed with stage
in 1 minute and 21 seconds
From a4206bb34ac454f3f5eea39a01d4f12ff3c0e981 Mon Sep 17 00:00:00 2001
From: necrophcodr <nc@scalehost.eu>
Date: Fri, 29 Nov 2019 09:22:14 +0100
Subject: [PATCH] Fix python.37 asyncio incompatability.
---
chaperone/cproc/commands.py | 4 ++--
chaperone/cproc/process_manager.py | 6 +++---
chaperone/cproc/pt/cron.py | 2 +-
chaperone/cproc/pt/inetd.py | 2 +-
chaperone/cproc/pt/simple.py | 2 +-
chaperone/cproc/subproc.py | 18 +++++++++---------
chaperone/cutil/notify.py | 2 +-
chaperone/cutil/syslog_handlers.py | 2 +-
chaperone/exec/sdnotify_exec.py | 6 +++---
9 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/chaperone/cproc/commands.py b/chaperone/cproc/commands.py
index 2b7a0dd..7d0a7c4 100644
--- a/chaperone/cproc/commands.py
+++ b/chaperone/cproc/commands.py
@@ -224,11 +224,11 @@ def _command_task(self, cmd, interactive = False):
diff '--exclude=.git' -urN chaperone.orig/chaperone/cproc/commands.py chaperone/chaperone/cproc/commands.py
--- chaperone.orig/chaperone/cproc/commands.py 2020-08-16 19:02:02.314880831 +0100
+++ chaperone/chaperone/cproc/commands.py 2020-08-16 19:01:47.787607120 +0100
@@ -224,11 +224,11 @@
def data_received(self, data):
if self.interactive:
......@@ -33,11 +15,10 @@ index 2b7a0dd..7d0a7c4 100644
class _InteractiveServer(Server):
diff --git a/chaperone/cproc/process_manager.py b/chaperone/cproc/process_manager.py
index 0ac74e7..4fa28cc 100644
--- a/chaperone/cproc/process_manager.py
+++ b/chaperone/cproc/process_manager.py
@@ -229,7 +229,7 @@ def kill_system(self, errno = None, force = False):
diff '--exclude=.git' -urN chaperone.orig/chaperone/cproc/process_manager.py chaperone/chaperone/cproc/process_manager.py
--- chaperone.orig/chaperone/cproc/process_manager.py 2020-08-16 19:02:02.314880831 +0100
+++ chaperone/chaperone/cproc/process_manager.py 2020-08-16 19:01:47.787607120 +0100
@@ -229,7 +229,7 @@
warn("Request made to kill system." + ((force and " (forced)") or ""))
self._killing_system = True
......@@ -46,7 +27,7 @@ index 0ac74e7..4fa28cc 100644
def _cancel_pending(self):
"Cancel any pending activated tasks"
@@ -289,7 +289,7 @@ def activate_result(self, future):
@@ -289,7 +289,7 @@
self._pending.discard(future)
def activate(self, cr):
......@@ -55,7 +36,7 @@ index 0ac74e7..4fa28cc 100644
future.add_done_callback(self.activate_result)
self._pending.add(future)
return future
@@ -341,7 +341,7 @@ def run_event_loop(self, startup_coro = None, exit_when_done = True):
@@ -341,7 +341,7 @@
to tailor the environment and start up other services as needed.
"""
......@@ -64,11 +45,10 @@ index 0ac74e7..4fa28cc 100644
initfuture.add_done_callback(lambda f: self._system_started(startup_coro, f))
self.loop.run_forever()
diff --git a/chaperone/cproc/pt/cron.py b/chaperone/cproc/pt/cron.py
index 803f289..e7e623c 100644
--- a/chaperone/cproc/pt/cron.py
+++ b/chaperone/cproc/pt/cron.py
@@ -93,7 +93,7 @@ def process_started_co(self):
diff '--exclude=.git' -urN chaperone.orig/chaperone/cproc/pt/cron.py chaperone/chaperone/cproc/pt/cron.py
--- chaperone.orig/chaperone/cproc/pt/cron.py 2020-08-16 19:02:02.314880831 +0100
+++ chaperone/chaperone/cproc/pt/cron.py 2020-08-16 19:01:47.787607120 +0100
@@ -93,7 +93,7 @@
# We have a successful start. Monitor this service.
......@@ -77,11 +57,10 @@ index 803f289..e7e623c 100644
self.add_pending(self._fut_monitor)
@asyncio.coroutine
diff --git a/chaperone/cproc/pt/inetd.py b/chaperone/cproc/pt/inetd.py
index d9728da..48a7a96 100644
--- a/chaperone/cproc/pt/inetd.py
+++ b/chaperone/cproc/pt/inetd.py
@@ -17,7 +17,7 @@ def acquire_socket(self, sock):
diff '--exclude=.git' -urN chaperone.orig/chaperone/cproc/pt/inetd.py chaperone/chaperone/cproc/pt/inetd.py
--- chaperone.orig/chaperone/cproc/pt/inetd.py 2020-08-16 19:02:02.314880831 +0100
+++ chaperone/chaperone/cproc/pt/inetd.py 2020-08-16 19:01:47.787607120 +0100
@@ -17,7 +17,7 @@
self._fd = sock.detach()
sock.close()
......@@ -90,11 +69,22 @@ index d9728da..48a7a96 100644
future.add_done_callback(self._done)
self.process.counter += 1
diff --git a/chaperone/cproc/pt/simple.py b/chaperone/cproc/pt/simple.py
index da8f258..c4548df 100644
--- a/chaperone/cproc/pt/simple.py
+++ b/chaperone/cproc/pt/simple.py
@@ -21,7 +21,7 @@ def process_started_co(self):
diff '--exclude=.git' -urN chaperone.orig/chaperone/cproc/pt/notify.py chaperone/chaperone/cproc/pt/notify.py
--- chaperone.orig/chaperone/cproc/pt/notify.py 2020-08-16 19:02:02.314880831 +0100
+++ chaperone/chaperone/cproc/pt/notify.py 2020-08-16 19:01:47.787607120 +0100
@@ -63,7 +63,7 @@
yield from self.do_startup_pause()
- self._fut_monitor = asyncio.async(self._monitor_service())
+ self._fut_monitor = asyncio.ensure_future(self._monitor_service())
self.add_pending(self._fut_monitor)
if self._ready_event:
diff '--exclude=.git' -urN chaperone.orig/chaperone/cproc/pt/simple.py chaperone/chaperone/cproc/pt/simple.py
--- chaperone.orig/chaperone/cproc/pt/simple.py 2020-08-16 19:02:02.314880831 +0100
+++ chaperone/chaperone/cproc/pt/simple.py 2020-08-16 19:01:47.787607120 +0100
@@ -21,7 +21,7 @@
# We have a successful start. Monitor this service.
......@@ -103,11 +93,10 @@ index da8f258..c4548df 100644
self.add_pending(self._fut_monitor)
@asyncio.coroutine
diff --git a/chaperone/cproc/subproc.py b/chaperone/cproc/subproc.py
index eae1d9a..c432c7d 100644
--- a/chaperone/cproc/subproc.py
+++ b/chaperone/cproc/subproc.py
@@ -478,12 +478,12 @@ def start_subprocess(self):
diff '--exclude=.git' -urN chaperone.orig/chaperone/cproc/subproc.py chaperone/chaperone/cproc/subproc.py
--- chaperone.orig/chaperone/cproc/subproc.py 2020-08-16 19:02:02.314880831 +0100
+++ chaperone/chaperone/cproc/subproc.py 2020-08-16 19:01:47.787607120 +0100
@@ -478,12 +478,12 @@
self.pid = proc.pid
if service.stdout == 'log':
......@@ -123,7 +112,7 @@ index eae1d9a..c432c7d 100644
yield from self.process_started_co()
@@ -574,7 +574,7 @@ def process_exit(self, code):
@@ -574,7 +574,7 @@
if code.normal_exit or self.kill_signal == code.signal:
return
......@@ -132,7 +121,7 @@ index eae1d9a..c432c7d 100644
@asyncio.coroutine
def _abnormal_exit(self, code):
@@ -602,7 +602,7 @@ def _abnormal_exit(self, code):
@@ -602,7 +602,7 @@
if controller.system_alive:
yield from self.reset()
#yield from self.start()
......@@ -141,7 +130,7 @@ index eae1d9a..c432c7d 100644
f.add_done_callback(self._restart_callback)
return
@@ -621,7 +621,7 @@ def _restart_callback(self, fut):
@@ -621,7 +621,7 @@
self.logdebug("{0} restart succeeded", self.name)
else:
self.logwarn("{0} restart failed: {1}", self.name, ex)
......@@ -150,7 +139,7 @@ index eae1d9a..c432c7d 100644
def _kill_system(self):
self.family.controller.kill_system()
@@ -887,7 +887,7 @@ def start(self, service_names, force = False, wait = False, enable = False):
@@ -887,7 +887,7 @@
yield from s.reset(dependents=True, enable=enable, restarts_ok=True)
if not wait:
......@@ -159,7 +148,7 @@ index eae1d9a..c432c7d 100644
else:
yield from self.run(slist)
@@ -909,7 +909,7 @@ def stop(self, service_names, force = False, wait = False, disable = False):
@@ -909,7 +909,7 @@
", ".join([s.shortname for s in slist if not s.stoppable]))
if not wait:
......@@ -168,7 +157,7 @@ index eae1d9a..c432c7d 100644
else:
for s in slist:
yield from s.stop()
@@ -936,7 +936,7 @@ def reset(self, service_names, force = False, wait = False):
@@ -936,7 +936,7 @@
raise Exception("can't reset services which are running: " + ", ".join([s.shortname for s in running]))
if not wait:
......@@ -177,11 +166,10 @@ index eae1d9a..c432c7d 100644
else:
for s in slist:
yield from s.reset(restarts_ok = True)
diff --git a/chaperone/cutil/notify.py b/chaperone/cutil/notify.py
index d942934..90c2827 100644
--- a/chaperone/cutil/notify.py
+++ b/chaperone/cutil/notify.py
@@ -153,7 +153,7 @@ def send(self, name, val):
diff '--exclude=.git' -urN chaperone.orig/chaperone/cutil/notify.py chaperone/chaperone/cutil/notify.py
--- chaperone.orig/chaperone/cutil/notify.py 2020-08-16 19:02:02.314880831 +0100
+++ chaperone/chaperone/cutil/notify.py 2020-08-16 19:01:47.787607120 +0100
@@ -153,7 +153,7 @@
self._sent.add(name)
if self._client:
debug("queueing '{0}={1}' to notify socket '{2}'".format(name, val, self._client.socket_name))
......@@ -190,11 +178,10 @@ index d942934..90c2827 100644
@asyncio.coroutine
def _do_send(self, msg):
diff --git a/chaperone/cutil/syslog_handlers.py b/chaperone/cutil/syslog_handlers.py
index 044ba7f..78c215b 100644
--- a/chaperone/cutil/syslog_handlers.py
+++ b/chaperone/cutil/syslog_handlers.py
@@ -133,7 +133,7 @@ def setup_handler(self):
diff '--exclude=.git' -urN chaperone.orig/chaperone/cutil/syslog_handlers.py chaperone/chaperone/cutil/syslog_handlers.py
--- chaperone.orig/chaperone/cutil/syslog_handlers.py 2020-08-16 19:02:02.314880831 +0100
+++ chaperone/chaperone/cutil/syslog_handlers.py 2020-08-16 19:01:47.787607120 +0100
@@ -133,7 +133,7 @@
def __init__(self, config):
super().__init__(config)
......@@ -203,11 +190,10 @@ index 044ba7f..78c215b 100644
def write(self, data):
if self._protocol:
diff --git a/chaperone/exec/sdnotify_exec.py b/chaperone/exec/sdnotify_exec.py
index 6af1170..af5d3b8 100644
--- a/chaperone/exec/sdnotify_exec.py
+++ b/chaperone/exec/sdnotify_exec.py
@@ -175,7 +175,7 @@ def _do_proxy_send(self, name, value):
diff '--exclude=.git' -urN chaperone.orig/chaperone/exec/sdnotify_exec.py chaperone/chaperone/exec/sdnotify_exec.py
--- chaperone.orig/chaperone/exec/sdnotify_exec.py 2020-08-16 19:02:02.314880831 +0100
+++ chaperone/chaperone/exec/sdnotify_exec.py 2020-08-16 19:01:47.787607120 +0100
@@ -175,7 +175,7 @@
yield from self.parent_client.send("{0}={1}".format(name, value))
def send_to_proxy(self, name, value):
......@@ -216,7 +202,7 @@ index 6af1170..af5d3b8 100644
def notify_received(self, which, name, value):
self.send_to_proxy(name, value)
@@ -217,7 +217,7 @@ def _run_process(self):
@@ -217,7 +217,7 @@
proc = yield from create
if self.timeout:
......@@ -225,7 +211,7 @@ index 6af1170..af5d3b8 100644
exitcode = yield from proc.wait()
if not self.exitcode: # may have arrived from ERRNO
@@ -248,7 +248,7 @@ def main_entry():
@@ -248,7 +248,7 @@
options = docopt(__doc__, options_first=True, version=VERSION_MESSAGE)
mainclass = SDNotifyExec(options)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment