From f6a5f56098fe4b6b8c113f2ef74ae0906f57d6f2 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sat, 26 Mar 2016 16:40:41 +0100 Subject: [PATCH] Use the same dir for ssh mux socket and Local base_path. --- scripts/cdist | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/cdist b/scripts/cdist index 265d73f0..9fa3ddb8 100755 --- a/scripts/cdist +++ b/scripts/cdist @@ -133,11 +133,16 @@ def commandline(): args_dict = vars(args) # if command with remote_copy and remote_exec params if 'remote_copy' in args_dict and 'remote_exec' in args_dict: + # if out_path is not set then create temp dir here so + # Local uses it for base_path and ssh mux socket is + # created in it. + if args_dict['out_path'] is None: + args.out_path = tempfile.mkdtemp() # if remote-exec and/or remote-copy args are None then user # didn't specify command line options nor env vars: # inspect multiplexing options for default cdist.REMOTE_COPY/EXEC if args_dict['remote_copy'] is None or args_dict['remote_exec'] is None: - control_path_dir = tempfile.mkdtemp(prefix="cdist.control.path") + control_path_dir = args.out_path import atexit atexit.register(lambda: shutil.rmtree(control_path_dir)) mux_opts = inspect_ssh_mux_opts(control_path_dir)