diff --git a/cdist/context.py b/cdist/context.py index 767b17a8..e0391be8 100644 --- a/cdist/context.py +++ b/cdist/context.py @@ -38,7 +38,7 @@ class Context(object): remote_copy, remote_exec, initial_manifest=False, - add_conf_dirs=[], + add_conf_dirs=None, exec_path=sys.argv[0], debug=False): diff --git a/cdist/exec/local.py b/cdist/exec/local.py index 7ef11458..7f640411 100644 --- a/cdist/exec/local.py +++ b/cdist/exec/local.py @@ -23,6 +23,7 @@ import io import os import sys +import re import subprocess import shutil import logging @@ -37,7 +38,7 @@ class Local(object): Directly accessing the local side from python code is a bug. """ - def __init__(self, target_host, out_path, exec_path, add_conf_dirs=[], cache_dir=None): + def __init__(self, target_host, out_path, exec_path, add_conf_dirs=None, cache_dir=None): self.target_host = target_host self.out_path = out_path @@ -92,6 +93,12 @@ class Local(object): if self.home_dir: self.conf_dirs.append(self.home_dir) + # Add directories defined in the CDIST_PATH environment variable + if 'CDIST_PATH' in os.environ: + cdist_path_dirs = re.split(r'(?