2021-01-08 13:41:50 +01:00
|
|
|
From 1558a1b092e56da005a26bc381238a3304904622 Mon Sep 17 00:00:00 2001
|
2019-10-10 13:49:11 +02:00
|
|
|
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
|
|
|
|
<psuarezhernandez@suse.com>
|
|
|
|
Date: Thu, 3 Oct 2019 15:19:02 +0100
|
|
|
|
Subject: [PATCH] Use current IOLoop for the LocalClient instance of
|
|
|
|
BatchAsync (bsc#1137642)
|
|
|
|
|
|
|
|
---
|
2021-01-08 13:41:50 +01:00
|
|
|
salt/cli/batch_async.py | 5 ++++-
|
|
|
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
2019-10-10 13:49:11 +02:00
|
|
|
|
|
|
|
diff --git a/salt/cli/batch_async.py b/salt/cli/batch_async.py
|
2021-01-08 13:41:50 +01:00
|
|
|
index 0a0b8f5f83..89405ba917 100644
|
2019-10-10 13:49:11 +02:00
|
|
|
--- a/salt/cli/batch_async.py
|
|
|
|
+++ b/salt/cli/batch_async.py
|
2021-01-08 13:41:50 +01:00
|
|
|
@@ -47,7 +47,9 @@ class BatchAsync:
|
|
|
|
|
2019-10-10 13:49:11 +02:00
|
|
|
def __init__(self, parent_opts, jid_gen, clear_load):
|
|
|
|
ioloop = tornado.ioloop.IOLoop.current()
|
2021-01-08 13:41:50 +01:00
|
|
|
- self.local = salt.client.get_local_client(parent_opts["conf_file"])
|
|
|
|
+ self.local = salt.client.get_local_client(
|
|
|
|
+ parent_opts["conf_file"], io_loop=ioloop
|
|
|
|
+ )
|
|
|
|
if "gather_job_timeout" in clear_load["kwargs"]:
|
|
|
|
clear_load["gather_job_timeout"] = clear_load["kwargs"].pop(
|
|
|
|
"gather_job_timeout"
|
|
|
|
@@ -276,6 +278,7 @@ class BatchAsync:
|
2019-10-10 13:49:11 +02:00
|
|
|
yield
|
|
|
|
|
|
|
|
def __del__(self):
|
|
|
|
+ self.local = None
|
|
|
|
self.event = None
|
|
|
|
self.ioloop = None
|
|
|
|
gc.collect()
|
|
|
|
--
|
2021-01-08 13:41:50 +01:00
|
|
|
2.29.2
|
2019-10-10 13:49:11 +02:00
|
|
|
|
|
|
|
|