Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fake "podman network exists" command
Motivation: podman-compose uses the "podman network exists" command to avoid creating the same network twice. This command was added with podman v3.1.0. Debian stable has an older version of podman (v3.0.1) that doesn't support the "podman network exists" command. A symptom of this problem is podman-compose failing with lines like: subprocess.CalledProcessError: Command '['podman', 'network', 'exists', 'scicatlive_default']' returned non-zero exit status 125. During handling of the above exception, another exception occurred: [...] subprocess.CalledProcessError: Command '['podman', 'network', 'create', '--labelect=scicatlive', 'scicatlive_default']' returned non-zero exit status 125. Modification: Abstract the two places where podman-compose checks if a network already exists. This is now handled by a specific method. Check the podman version. If the podman version is earlier than v3.1.0 then simulate the "podman network exists" command by parsing the output from "podman network ls", otherwise simply call the "podman network exists" command directly. Result: podman-compose is now able to create a network with versions of podman before v3.1.0. Signed-off-by: Paul Millar <[email protected]>
- Loading branch information