mirror of
https://github.com/containers/ansible-podman-collections.git
synced 2026-02-04 07:11:49 +00:00
Fix file copy in buildah
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
This commit is contained in:
parent
ed1c5f5f42
commit
3aa2a46c94
1 changed files with 6 additions and 0 deletions
|
|
@ -423,6 +423,12 @@ class Connection(ConnectionBase):
|
|||
shutil.chown(real_out_path, user=self.get_option("remote_user"))
|
||||
except (OSError, LookupError) as e:
|
||||
display.vvv(f"Could not change ownership via mount: {e}", host=self._container_id)
|
||||
# Remove the file and fall back to buildah copy
|
||||
try:
|
||||
os.remove(real_out_path)
|
||||
except OSError:
|
||||
pass
|
||||
raise Exception("Ownership change failed, falling back to buildah copy")
|
||||
return
|
||||
except Exception as e:
|
||||
display.vvv(f"Mount copy failed, falling back to buildah copy: {e}", host=self._container_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue