Skip to content

Commit

Permalink
sigh
Browse files Browse the repository at this point in the history
  • Loading branch information
zardus committed Oct 15, 2024
1 parent 626c245 commit ad3c113
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions dojo_plugin/scripts/pull_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)

for image, in DojoChallenges.query.with_entities(db.distinct(DojoChallenges.data["image"])).all()
if not image or image.startswith("mac:") or image.startswith("pwncollege-"):
continue
for image, in DojoChallenges.query.with_entities(db.distinct(DojoChallenges.data["image"])).all():
if not image or image.startswith("mac:") or image.startswith("pwncollege-"):
continue

for client in all_docker_clients():
logger.info(f"Pulling image {image} on {client.api.base_url}...")
try:
client.images.pull(image)
except docker.errors.ImageNotFound:
logger.error(f"... image not found: {image} on {client.api.base_url}...")
except Exception as e:
logger.error(f"... error: {image} on {client.api.base_url}...", exc_info=e)
for client in all_docker_clients():
logger.info(f"Pulling image {image} on {client.api.base_url}...")
try:
client.images.pull(image)
except docker.errors.ImageNotFound:
logger.error(f"... image not found: {image} on {client.api.base_url}...")
except Exception as e:
logger.error(f"... error: {image} on {client.api.base_url}...", exc_info=e)

0 comments on commit ad3c113

Please sign in to comment.