From 0b8989d190572f4732262f7357b6f3c977a76b0c Mon Sep 17 00:00:00 2001 From: renanllisboa Date: Mon, 2 Dec 2024 10:35:28 -0300 Subject: [PATCH] change post_exec ConfigLoader call --- tir/technologies/core/numexec.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tir/technologies/core/numexec.py b/tir/technologies/core/numexec.py index 2850592c0..abeba7557 100644 --- a/tir/technologies/core/numexec.py +++ b/tir/technologies/core/numexec.py @@ -7,10 +7,10 @@ import os -class NumExec(ConfigLoader): +class NumExec(): def __init__(self): - super().__init__() + self.config = ConfigLoader() def post_exec(self, url, numexec_folder): @@ -34,20 +34,20 @@ def post_exec(self, url, numexec_folder): time.sleep(12) if error: - response = str(f"STATUS: {status} Url: {url} ID: {self.num_exec} Error: {error}") + response = str(f"STATUS: {status} Url: {url} ID: {self.config.num_exec} Error: {error}") else: - response = str(f"STATUS: {status} Url: {url} ID: {self.num_exec}") + response = str(f"STATUS: {status} Url: {url} ID: {self.config.num_exec}") logger().debug(response) if status not in success_response: try: - path = Path(self.log_folder, numexec_folder) + path = Path(self.config.log_folder, numexec_folder) os.makedirs(path) except OSError: pass - with open(Path(path, f"{self.num_exec}_TIR_{strftime}.txt"), "w") as json_log: + with open(Path(path, f"{self.config.num_exec}_TIR_{strftime}.txt"), "w") as json_log: json_log.write(response) return status in success_response @@ -63,7 +63,7 @@ def send_request(self, url): "https": None, } - data = {'num_exec': self.num_exec, 'ip_exec': self.ipExec} + data = {'num_exec': self.config.num_exec, 'ip_exec': self.config.ipExec} response = requests.post(url.strip(), json=data, proxies=proxies)