This commit is contained in:
Zsolt Ero
2023-12-21 02:35:20 +01:00
parent 2d9e5f2f4f
commit 48736bf87b
7 changed files with 49 additions and 16 deletions

View File

@@ -3,11 +3,13 @@ import secrets
import string
def put(c, local_path, remote_path, permissions=None, owner='root', group=None):
def put(
c, local_path, remote_path, permissions=None, owner='root', group=None, target_is_dir=False
):
tmp_path = f'/tmp/fabtmp_{random_string(8)}'
c.put(local_path, tmp_path)
if is_dir(c, remote_path):
if is_dir(c, remote_path) or target_is_dir:
if not remote_path.endswith('/'):
remote_path += '/'