From 61b52ac8065efe3366f8d345d1cc6f5c22c2c043 Mon Sep 17 00:00:00 2001
From: Philippe Gregoire <gregoire.philippe.4@courrier.uqam.ca>
Date: Mon, 14 Aug 2017 16:13:57 -0400
Subject: [PATCH] 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: