Package list python-castellan / 0e2cc05
Update docs with parsing config files Updates the usage documentation for castellan to explain how to parse the castellan configuration files. Change-Id: Iaa93310d7c25ccee47feb85eddf63ae3df1eedca Christopher Solis 5 years ago
1 changed file(s) with 35 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
194194 $ tox -e genconfig
197 Parsing the configuration files
198 -------------------------------
200 Castellan does not parse the configuration files by default. When you create
201 the files and occupy them, you still need to manipulate the
202 ``oslo_config.cfg.ConfigOpts`` object before passing it to the
203 ``castellan.key_manager.API`` object. You can create a list of locations where
204 the configuration files reside. If multiple configuration files are
205 specified, the variables will be used from the most recently parsed file and
206 overwrite any previous variables. In the example below, the configuration
207 file in the ``/etc/castellan`` directory will overwrite the values found in
208 the file in the user's home directory. If a file is not found in one of the
209 specified locations, then a file not found error will occur.
211 **Example. Parsing the config files.**
213 .. code:: python
215 from oslo_config import cfg
216 from castellan import key_manager
218 conf = cfg.ConfigOpts()
219 conf(['~/castellan.conf', '/etc/castellan/castellan.conf'])
220 manager = key_manager.API(configuration=conf)
222 There are two options for parsing the Castellan values from a
223 configuration file:
225 - The values can be placed in a separate file.
226 - You can include the values in a configuration file you already use.
228 In order to see all of the default values used by Castellan, generate a
229 sample configuration by referring to the section directly above.
196231 Adding castellan to configuration files
197232 ---------------------------------------