Skip to content

Commit

Permalink
Merge pull request #395 from inknos/fix-readme
Browse files Browse the repository at this point in the history
Fix README TypeError when one container is running
  • Loading branch information
openshift-merge-bot[bot] authored May 30, 2024
2 parents 2262bd3 + b8c0c85 commit 8267ed2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ with PodmanClient(base_url=uri) as client:

# find all containers
for container in client.containers.list():
first_name = container['Names'][0]
container = client.containers.get(first_name)
# After a list call you would probably want to reload the container
# to get the information about the variables such as status.
# Note that list() ignores the sparse option and assumes True by default.
container.reload()
print(container, container.id, "\n")
print(container, container.status, "\n")

# available fields
print(sorted(container.attrs.keys()))
Expand Down

0 comments on commit 8267ed2

Please sign in to comment.