Skip to content

Commit

Permalink
Add more logging info to processes. That time in a try except block
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusStrobl committed Apr 3, 2024
1 parent 398ea47 commit d52774c
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions processes/podman_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,21 @@ def pull_run_image(client, image_name, container_name, environment=None, mounts=

print(f"Running Podman container: {container_name}")
logging.info(f"Running Podman container: {container_name}")
container = client.containers.run(
image=image_name,
detach=True,
name=container_name,
environment=environment,
mounts=mounts,
network_mode=network_mode,
# volumes=volumes,
command=command,
remove=False
)
logging.info(f"Container to use: {container}")
try:
container = client.containers.run(
image=image_name,
detach=True,
name=container_name,
environment=environment,
mounts=mounts,
network_mode=network_mode,
# volumes=volumes,
command=command,
remove=False
)
logging.info(f"Container to use: {container}")
except Exception as e:
logging.info(f"Cannot run client.container. Error: {e}")

# Start the container
container.start()
Expand Down

0 comments on commit d52774c

Please sign in to comment.