Skip to content
Permalink
Browse files

podman,conn: raise and exc when podman mount fails

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
  • Loading branch information...
TomasTomecek committed Jun 9, 2019
1 parent 56730f3 commit caf6b4753b3585bdf0a2b48eddf0ac501c567e81
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/ansible/plugins/connection/podman.py
@@ -14,6 +14,7 @@
import shutil
import subprocess

from ansible.errors import AnsibleError
from ansible.module_utils._text import to_bytes, to_native
from ansible.plugins.connection import ConnectionBase, ensure_connect
from ansible.utils.display import Display
@@ -99,8 +100,10 @@ def _connect(self):
"""
super(Connection, self)._connect()
rc, self._mount_point, stderr = self._podman("mount")
self._mount_point = self._mount_point.strip()
display.vvvvv("MOUNTPOINT %s RC %s STDERR %r" % (self._mount_point, rc, stderr))
if rc:
raise AnsibleError("Unable to mount filesystem of a container: %r" % stderr)
self._mount_point = self._mount_point.strip()
self._connected = True

@ensure_connect

0 comments on commit caf6b47

Please sign in to comment.
You can’t perform that action at this time.