From f2f00f811087f93434459b27dc7556829b1a48dc Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Wed, 22 Feb 2023 11:29:06 +0800 Subject: [PATCH] Update shell_execute.py --- appmanage/api/utils/shell_execute.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/appmanage/api/utils/shell_execute.py b/appmanage/api/utils/shell_execute.py index 9da87fe2..c9cbe907 100644 --- a/appmanage/api/utils/shell_execute.py +++ b/appmanage/api/utils/shell_execute.py @@ -46,3 +46,8 @@ def execute_CommandReturn(cmd_str, timeout=30, timeinner=3): print('\n此次任务执行失败,请根据下面错误原因排查:') print(out_str) +def execute_command_output(cmd_str): + print(cmd_str) + out_str = subprocess.getoutput (cmd_str) + print(out_str) + return out_str