Fixes #152: validate that podman is useable

This commit is contained in:
Muayyad alsadi 2020-04-18 22:18:36 +03:00
parent 5215782cba
commit 07a2430c41

View File

@ -798,8 +798,8 @@ class PodmanCompose:
else: else:
# this also works if podman hasn't been installed now # this also works if podman hasn't been installed now
if args.dry_run == False: if args.dry_run == False:
raise IOError( sys.stderr.write("Binary {} has not been found.\n".format(podman_path))
"Binary {} has not been found.".format(podman_path)) exit(1)
self.podman = Podman(self, podman_path, args.dry_run) self.podman = Podman(self, podman_path, args.dry_run)
if not args.dry_run: if not args.dry_run:
# just to make sure podman is running # just to make sure podman is running
@ -808,8 +808,8 @@ class PodmanCompose:
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
self.podman_version = None self.podman_version = None
if not self.podman_version: if not self.podman_version:
sys.stderr.write('it seems that you do not useable `podman`\n') sys.stderr.write("it seems that you do not have `podman` installed\n")
exit(-1) exit(1)
print("using podman version: "+self.podman_version) 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]