mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-22 23:50:31 +00:00
Update shell_execute.py
This commit is contained in:
parent
b4ff55352a
commit
16a5168297
1 changed files with 2 additions and 2 deletions
|
@ -60,8 +60,8 @@ def execute_command_output_all(cmd_str, max_time = 3):
|
|||
while excutetime < max_time:
|
||||
process = subprocess.run(cmd_str, shell=True, stdout=subprocess.PIPE, universal_newlines=True)
|
||||
if process.returncode == 0:
|
||||
return process.stdout
|
||||
return {"code": "0", "result": process.stdout,}
|
||||
else:
|
||||
excutetime = excutetime + 1
|
||||
|
||||
return "command excute failed, please check your command!"
|
||||
return {"code": "-1", "result": "command excute failed, please check your command!"}
|
||||
|
|
Loading…
Reference in a new issue