From 5508f274a92ec8313b00f906f308053b153bcb09 Mon Sep 17 00:00:00 2001 From: pengtao Date: Mon, 14 Oct 2019 14:04:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data_channel/gamelog_external.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/data_channel/gamelog_external.py b/data_channel/gamelog_external.py index d0bba52..b32135d 100644 --- a/data_channel/gamelog_external.py +++ b/data_channel/gamelog_external.py @@ -51,8 +51,10 @@ class Build_Gamelog_Config(): ),""" except Exception: log.error(f"build context failed with {line}.", exc_info=True) + return False with open(self.filename, 'w') as f: f.write(f"{start}\n{content}\n{end}") + return True def deploy_config(self): ip_addr = self.get_ip_addr() @@ -89,8 +91,9 @@ class Build_Gamelog_Config(): def run(self): keys = self.get_keys() - print(f"1={keys}") data = self.split_data(keys) - print(f"2={data}") - self.build_config(data) - self.deploy_config() + if self.build_config(data): + if self.deploy_config(): + log.info("deploy config 2 gamelog success!") + else: + log.error("deploy config failed!")