Thursday, 21 March 2013
Paste config in OpenStack
If you are new to OpenStack you may be wondering what ini files like this are all about. OpenStack services (Nova, Glance, Quantum etc) use Paste Deployment to wire up middleware like authorisation, API extensions, request rate limiting etc. It helps to have a basic knowledge of this stuff for installing and troubleshooting. This post is a simple example based on this presentation. Here I have put the various parts in different modules.
First the application in a module named app_layer which uses WebOb
Then a filter that does simple authorisation in a module named auth_layer
Then the paste configuration file
Finally a script to load the application based on the configuration file
So this script reads the config file, and for each item in the pipeline list, it jumps to that section to find the module name and factory function name for it. Now it is possible to see how the http server can be setup so incoming requests will flow through a pipeline of functions that were returned by the factories.
So now by just editing the config file, you can swap out the auth for a different implementation, or remove it completely, or add more filters.