mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-30 20:43:02 +02:00
Fix #1466: 'show container' shows no output
A container's command line, as reported by podman, may comtain environment
variables, which the current regexp (added in ed4fe58) does not support.
Extend the regexp to allow environment variables and add an operational,
config false, 'cmdline' leaf node to allow any characters to be reported
for the full command line in the operational output.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -223,16 +223,21 @@ def container(ps):
|
||||
"status": ps["Status"]
|
||||
}
|
||||
|
||||
# Bonus information, may not be available
|
||||
if ps["Command"]:
|
||||
out["command"] = " ".join(ps["Command"])
|
||||
|
||||
inspect = podman_inspect(out["name"])
|
||||
if inspect and isinstance(inspect, list) and len(inspect) > 0:
|
||||
inspect = inspect[0]
|
||||
else:
|
||||
inspect = {}
|
||||
|
||||
path = inspect.get("Path", "")
|
||||
args = inspect.get("Args", [])
|
||||
if path:
|
||||
out["cmdline"] = " ".join([path] + args)
|
||||
|
||||
cmd = inspect.get("Config", {}).get("Cmd", [])
|
||||
if cmd:
|
||||
out["command"] = " ".join(cmd)
|
||||
|
||||
net = network(ps, inspect)
|
||||
if net:
|
||||
out["network"] = net
|
||||
|
||||
Reference in New Issue
Block a user