qiaofeng1227 преди 2 години
родител
ревизия
87a4431ec6
променени са 1 файла, в които са добавени 3 реда и са изтрити 4 реда
  1. 3 4
      appmanage/api/utils/docker.py

+ 3 - 4
appmanage/api/utils/docker.py

@@ -152,13 +152,12 @@ def check_app_websoft9(app_name):
 
 
 def check_directory(path):
-    output = shell_execute.execute_command_output_all("ls " + path)
-    if int(output["code"]) == 0:
+    try:
+        shell_execute.execute_command_output_all("ls " + path)
         return True
-    else:
+    except CommandException as ce:
         return False
 
-
 def check_app_compose(path):
     myLogger.info_logger("Checking port...")
     port_dic = read_env(path, "APP_.*_PORT")