mirror of
https://github.com/containers/podman-compose.git
synced 2025-01-24 06:48:45 +01:00
Fixes #152: validate that podman is useable
This commit is contained in:
parent
80e7ba188d
commit
5215782cba
@ -797,11 +797,20 @@ class PodmanCompose:
|
|||||||
podman_path = os.path.realpath(podman_path)
|
podman_path = os.path.realpath(podman_path)
|
||||||
else:
|
else:
|
||||||
# this also works if podman hasn't been installed now
|
# this also works if podman hasn't been installed now
|
||||||
if dry_run == False:
|
if args.dry_run == False:
|
||||||
raise IOError(
|
raise IOError(
|
||||||
"Binary {} has not been found.".format(podman_path))
|
"Binary {} has not been found.".format(podman_path))
|
||||||
|
|
||||||
self.podman = Podman(self, podman_path, args.dry_run)
|
self.podman = Podman(self, podman_path, args.dry_run)
|
||||||
|
if not args.dry_run:
|
||||||
|
# just to make sure podman is running
|
||||||
|
try:
|
||||||
|
self.podman_version = self.podman.output(["--version"]).decode('utf-8').strip()
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
self.podman_version = None
|
||||||
|
if not self.podman_version:
|
||||||
|
sys.stderr.write('it seems that you do not useable `podman`\n')
|
||||||
|
exit(-1)
|
||||||
|
print("using podman version: "+self.podman_version)
|
||||||
cmd_name = args.command
|
cmd_name = args.command
|
||||||
cmd = self.commands[cmd_name]
|
cmd = self.commands[cmd_name]
|
||||||
cmd(self, args)
|
cmd(self, args)
|
||||||
|
Loading…
Reference in New Issue
Block a user