From 7b0b3d9415323534a85c284a3714358979cc5a3f Mon Sep 17 00:00:00 2001 From: Philippe Gregoire Date: Mon, 14 Aug 2017 14:25:19 -0400 Subject: [PATCH 1/2] Fix remote cmds cleanup When --remote-copy and --remote-exec are provided, args.remote_cmds_cleanup_pattern is not set. This patches fixes the evaluation of args.remote_cmds_cleanup_pattern and prevents cdist from throwing an exception when --remote-copy and --remote-exec are used. --- cdist/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdist/config.py b/cdist/config.py index cdff47eb..4cba4948 100644 --- a/cdist/config.py +++ b/cdist/config.py @@ -270,7 +270,7 @@ class Config(object): remote_copy = args.remote_copy_pattern.format(control_path) else: remote_copy = args.remote_copy - if args.remote_cmds_cleanup_pattern: + if 'remote_cmds_cleanup_pattern' in args: remote_cmds_cleanup = args.remote_cmds_cleanup_pattern.format( control_path) else: From 61b52ac8065efe3366f8d345d1cc6f5c22c2c043 Mon Sep 17 00:00:00 2001 From: Philippe Gregoire Date: Mon, 14 Aug 2017 16:13:57 -0400 Subject: [PATCH 2/2] Set default remote_cmds_cleanup_pattern Fixes an exception when --remote-copy and --remote-exec are used. --- cdist/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cdist/config.py b/cdist/config.py index 4cba4948..14533237 100644 --- a/cdist/config.py +++ b/cdist/config.py @@ -80,6 +80,7 @@ class Config(object): @staticmethod def construct_remote_exec_copy_patterns(args): # default remote cmd patterns + args.remote_cmds_cleanup_pattern = "" args.remote_exec_pattern = None args.remote_copy_pattern = None @@ -270,7 +271,7 @@ class Config(object): remote_copy = args.remote_copy_pattern.format(control_path) else: remote_copy = args.remote_copy - if 'remote_cmds_cleanup_pattern' in args: + if args.remote_cmds_cleanup_pattern: remote_cmds_cleanup = args.remote_cmds_cleanup_pattern.format( control_path) else: