heyudev 2 年之前
父节点
当前提交
5c755b613f
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      longvideo_update.py

+ 4 - 0
longvideo_update.py

@@ -121,13 +121,17 @@ def remove_container_image(client, instance_id, container_name_list):
             logging.error(f"容器不存在或者无法删除当前容器, instance = {instance_id}/{ip_address}")
             sys.exit()
         try:
+            flag = False
             for container_name in container_name_list:
                 try:
                     container_id = client.containers.get(container_name)
                     container_id.remove(force=True)
+                    flag = True
                     break
                 except:
                     continue
+            if flag:
+                break
         except Exception as e:
             i += 1