Skip to content

Commit ac81cc5

Browse files
committed
fix ec ps for podman local
1 parent 038bf37 commit ac81cc5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/epics_containers_cli/ioc/local_commands.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,13 @@ def ps(self, all: bool, wide: bool):
168168
f'--format "{format}"',
169169
interactive=False,
170170
)
171-
# this regex extracts just the version from the set of all labels
172-
result = re.sub(r"%.*?[,%]version=([^,%]*).*?%", r"%\1%", str(result))
171+
172+
# this regex extracts just the version from the set of all labels,
173+
# docker and podman have different output formats
174+
if self.docker.is_docker:
175+
result = re.sub(r"%.*?[,%]version=([^,%]*).*?%", r"%\1%", str(result))
176+
else:
177+
result = re.sub(r"%.*? version:([^\],%]*).*?%", r"%\1%", str(result))
173178

174179
lines = ["IOC NAME%VERSION%STATUS%IMAGE"]
175180
lines += str(result).splitlines()

0 commit comments

Comments
 (0)