From 9aa14333a46d3a57c1fc9fad6068090eb029070f Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Mon, 10 Nov 2008 15:53:10 -0700 Subject: [PATCH] Added 'conf_dir' env variable, which is directory containing config files --- ipalib/__init__.py | 2 +- ipalib/config.py | 2 ++ ipalib/constants.py | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ipalib/__init__.py b/ipalib/__init__.py index 90a76a314..d943a7c76 100644 --- a/ipalib/__init__.py +++ b/ipalib/__init__.py @@ -520,7 +520,7 @@ This will typically be called before any plugins are registered. For example: 7 >>> api.bootstrap(in_server=True) # We want to execute, not forward >>> len(api.env) -33 +34 If your plugin requires new environment variables *and* will be included in the freeIPA built-in plugins, you should add the defaults for your variables diff --git a/ipalib/config.py b/ipalib/config.py index aa7d9cdf3..1bec57e56 100644 --- a/ipalib/config.py +++ b/ipalib/config.py @@ -186,6 +186,8 @@ class Env(object): self.conf = path.join(base, '%s.conf' % self.context) if 'conf_default' not in self: self.conf_default = path.join(base, 'default.conf') + if 'conf_dir' not in self: + self.conf_dir = base def _finalize_core(self, **defaults): """ diff --git a/ipalib/constants.py b/ipalib/constants.py index 9bd82a1bf..b8f93d211 100644 --- a/ipalib/constants.py +++ b/ipalib/constants.py @@ -115,6 +115,7 @@ DEFAULT_CONFIG = ( ('context', None), # Name of context, default is 'default' ('conf', None), # Path to config file ('conf_default', None), # Path to common default config file + ('conf_dir', None), # Directory containing config files # Set in Env._finalize_core(): ('in_server', None), # Whether or not running in-server (bool)