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