From 74a59dc50158f07dd538840eaba9033f464799b5 Mon Sep 17 00:00:00 2001 From: Chris Solis Date: Wed, 16 Mar 2016 11:11:43 -0600 Subject: [PATCH] Update docs for reading conf files This patch updates the documents for how to parse configuration files within Castellan. It is attempting to be consistent with how other projects achieve the same thing. Change-Id: Idd0621da37d2ea5193ee0da9e6ee81f803a005cd --- doc/source/usage.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/source/usage.rst b/doc/source/usage.rst index 979a40a0..ca438558 100644 --- a/doc/source/usage.rst +++ b/doc/source/usage.rst @@ -270,14 +270,14 @@ Parsing the configuration files Castellan does not parse the configuration files by default. When you create the files and occupy them, you still need to manipulate the -``oslo_config.cfg.ConfigOpts`` object before passing it to the +``oslo_config.cfg`` object before passing it to the ``castellan.key_manager.API`` object. You can create a list of locations where the configuration files reside. If multiple configuration files are specified, the variables will be used from the most recently parsed file and overwrite any previous variables. In the example below, the configuration file in the ``/etc/castellan`` directory will overwrite the values found in the file in the user's home directory. If a file is not found in one of the -specified locations, then a file not found error will occur. +specified locations, then a config file not found error will occur. **Example. Parsing the config files.** @@ -286,8 +286,9 @@ specified locations, then a file not found error will occur. from oslo_config import cfg from castellan import key_manager - conf = cfg.ConfigOpts() - conf(['~/castellan.conf', '/etc/castellan/castellan.conf']) + conf=cfg.CONF + config_files = ['~/castellan.conf', '/etc/castellan/castellan.conf'] + conf(default_config_files=config_files) manager = key_manager.API(configuration=conf) There are two options for parsing the Castellan values from a