From 378c7f6a89ca98aac4c657051a63a2f1139d2c63 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 1 Mar 2018 20:12:21 +0100 Subject: [PATCH] Support in-distribution config file --- cdist/configuration.py | 5 ++++- docs/changelog | 1 + docs/src/cdist-configuration.rst | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cdist/configuration.py b/cdist/configuration.py index ea916107..5737105a 100644 --- a/cdist/configuration.py +++ b/cdist/configuration.py @@ -275,7 +275,10 @@ class Configuration(metaclass=Singleton): os.environ.get('XDG_CONFIG_HOME', os.path.expanduser('~/.config/cdist')), _config_basename) - default_config_files = (_global_config_file, _local_config_file, ) + _dist_config_file = os.path.join( + os.path.abspath(os.path.join(os.path.dirname(cdist.__file__), "conf")), + 'cdist.cfg') + default_config_files = (_global_config_file, _dist_config_file, _local_config_file, ) ENV_VAR_CONFIG_FILE = 'CDIST_CONFIG_FILE' VERBOSITY_VALUES = _VERBOSITY_VALUES diff --git a/docs/changelog b/docs/changelog index 3c22ae35..20bfda0f 100644 --- a/docs/changelog +++ b/docs/changelog @@ -12,6 +12,7 @@ next: * Core: Fix lost error info with parallel jobs (option -j) (Darko Poljak) * Core: Fix determining beta value through configuration (Darko Poljak) * Core: Fix determining save_output_streams value through configuration (Darko Poljak) + * Core: Support in-distribution config file (Darko Poljak) 4.8.0: 2018-02-14 * Core: Skip empty lines in parameter files (Darko Poljak) diff --git a/docs/src/cdist-configuration.rst b/docs/src/cdist-configuration.rst index a66ddf7c..cf1e373b 100644 --- a/docs/src/cdist-configuration.rst +++ b/docs/src/cdist-configuration.rst @@ -11,6 +11,7 @@ order: #. configuration file specified in CDIST_CONFIG_FILE environment variable #. environment variables #. user's configuration file (first one found of ~/.cdist.cfg, $XDG_CONFIG_HOME/cdist/cdist.cfg, in specified order) + #. in-distribution configuration file (cdist/conf/cdist.cfg) #. system-wide configuration file (/etc/cdist.cfg) if one exists.