From 9a9caae9239cace897c273a56aad1790c1cb5b27 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 7 Jul 2022 15:39:06 +0000 Subject: [PATCH] Fix where path is expanded --- bootstrap-daemon/pvcbootstrapd/lib/hooks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap-daemon/pvcbootstrapd/lib/hooks.py b/bootstrap-daemon/pvcbootstrapd/lib/hooks.py index e9d44ef..3ebdc7b 100755 --- a/bootstrap-daemon/pvcbootstrapd/lib/hooks.py +++ b/bootstrap-daemon/pvcbootstrapd/lib/hooks.py @@ -203,8 +203,6 @@ def run_hook_copy(config, targets, args): node_address = node.host_ipaddr source = args.get("source", []) - if not match(r"^/", source): - source = f"{config['ansible_source']}/{source}" destination = args.get("destination", []) mode = args.get("mode", []) @@ -212,6 +210,8 @@ def run_hook_copy(config, targets, args): with run_paramiko(config, node_address) as c: for sfile, dfile, dmode in zip(source, destination, mode): + if not match(r"^/", sfile): + sfile = f"{config['ansible_source']}/{sfile}" tc = c.open_sftp() tc.put(sfile, dfile) tc.chmod(dfile, dmode)