From 2d4018d227486d3a1e4eec9ad5b1df95512e40b5 Mon Sep 17 00:00:00 2001 From: Sagi Shnaidman Date: Mon, 4 May 2020 21:14:06 +0300 Subject: [PATCH] Run pause=false w/o message condition --- plugins/connection/podman.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/plugins/connection/podman.py b/plugins/connection/podman.py index 6cb96b5..1ea1f94 100644 --- a/plugins/connection/podman.py +++ b/plugins/connection/podman.py @@ -166,15 +166,14 @@ class Connection(ConnectionBase): "cp", [in_path, self._container_id + ":" + out_path], use_container_id=False ) if rc != 0: - if 'cannot copy into running rootless container with pause set' in to_native(stderr): - rc, stdout, stderr = self._podman( - "cp", ["--pause=false", in_path, self._container_id + ":" + out_path], use_container_id=False + rc, stdout, stderr = self._podman( + "cp", ["--pause=false", in_path, self._container_id + ":" + out_path], use_container_id=False + ) + if rc != 0: + raise AnsibleError( + "Failed to copy file from %s to %s in container %s\n%s" % ( + in_path, out_path, self._container_id, stderr) ) - if rc != 0: - raise AnsibleError( - "Failed to copy file from %s to %s in container %s\n%s" % ( - in_path, out_path, self._container_id, stderr) - ) else: real_out_path = self._mount_point + to_bytes(out_path, errors='surrogate_or_strict') shutil.copyfile(