From b7f88bf8e4dbb285acabca09b292a029665f2c68 Mon Sep 17 00:00:00 2001 From: royenheart Date: Sun, 18 Sep 2022 02:35:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DPython=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E6=97=B6=E5=9B=A0=E8=A7=A3=E9=87=8A=E5=99=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=AF=BC=E8=87=B4=E7=9A=84=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/executeService.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/executeService.py b/src/executeService.py index b2dfe1f..77f8f84 100644 --- a/src/executeService.py +++ b/src/executeService.py @@ -33,7 +33,7 @@ class ExecuteService: def exec_popen(self, cmd, isPrint=True): if isPrint: self.print_cmd(cmd) - output = os.popen(cmd).readlines() + output = os.popen("bash -c \"{}\"".format(cmd)).readlines() return output def get_duration(self): @@ -47,7 +47,7 @@ class ExecuteService: cmd = self.join_cmd(cmds) if not cmd.startswith('echo'): self.print_cmd(cmd) - state = os.system(cmd) + state = os.system("bash -c \"{}\"".format(cmd)) self.end_time = self.tool.get_time_stamp() print(f"total time used: {self.get_duration()}s") logger.info(self.end_flag + cmd) -- Gitee