From ba063fb1e705997143191cf2aa97ed8cb8a86078 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 18 Feb 2022 12:05:42 +0100 Subject: vidhar: ... --- hosts/vidhar/borg/copy.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'hosts') diff --git a/hosts/vidhar/borg/copy.py b/hosts/vidhar/borg/copy.py index e82c2286..91c65e1e 100755 --- a/hosts/vidhar/borg/copy.py +++ b/hosts/vidhar/borg/copy.py @@ -244,14 +244,15 @@ def main(): if 'CREDENTIALS_DIRECTORY' in os.environ: def do_chown(path): - os.chown(pathlib.Path(root) / pathlib.Path(path), borg_pwd.pw_uid, borg_pwd.pw_gid) + os.chown(path, borg_pwd.pw_uid, borg_pwd.pw_gid) do_chown(os.environ['CREDENTIALS_DIRECTORY']) for root, dirs, files in os.walk(os.environ['CREDENTIALS_DIRECTORY']): + root_path = pathlib.Path(root) for dir in dirs: - do_chown(dir) + do_chown(root_path / pathlib.Path(dir)) for file in files: - do_chown(file) + do_chown(root_path / pathlib.Path(file)) if "::" in args.source: (src_repo_path, _, src_archive) = args.source.partition("::") -- cgit v1.2.3