From d7a2dfddbc2dc9ae4cea7d65e56d61a6a4d2b928 Mon Sep 17 00:00:00 2001 From: Tomas Krizek Date: Oct 06 2016 17:21:26 +0000 Subject: ipa: allow relative paths for config file Remove unnecessary check for absolute file paths for config file. https://fedorahosted.org/freeipa/ticket/6114 Reviewed-By: Petr Spacek Reviewed-By: Martin Basti --- diff --git a/ipalib/config.py b/ipalib/config.py index eb6c3ae..a273e3d 100644 --- a/ipalib/config.py +++ b/ipalib/config.py @@ -352,23 +352,10 @@ class Env(object): containing first the number of variables that were actually set, and second the total number of variables found in ``config_file``. - This method will raise a ``ValueError`` if ``config_file`` is not an - absolute path. For example: - - >>> env = Env() - >>> env._merge_from_file('my/config.conf') - Traceback (most recent call last): - ... - ValueError: config_file must be an absolute path; got 'my/config.conf' - Also see `Env._merge()`. - :param config_file: Absolute path of the configuration file to load. + :param config_file: Path of the configuration file to load. """ - if path.abspath(config_file) != config_file: - raise ValueError( - 'config_file must be an absolute path; got %r' % config_file - ) if not path.isfile(config_file): return parser = RawConfigParser()