config¶
Manage the accre config from a file.
The ACCRE python library configuration file is searched for in the following locations by default:
/etc/accre-admintools.conf
/etc/accre-admintools-auth.conf
/usr/local/etc/accre-admintools.conf
/usr/local/etc/accre-admintools-auth.conf
$HOME/.accre-admintools.conf
If the file is found in multiple locations above, the latter will take precidence and override options set in the previous. The “auth” files are intended to hold authentication credentials only and be available to privileged users.
If the environment variable ACCRE_PYTOOLS_CONF is set, then the configuration will be loaded from that file instead.
- accre.config.get_config(filename=None)[source]¶
Return the accre library configuration, and load from a file if the configuration has not already been loaded.
- Parameters:
filename (str|None) – Path to the configuration file. If None, use the default configuration locations.
- Returns:
The accre library configuration object
- Return type:
configparser.ConfigParser