[openstack-dev] [devstack] Overriding settings file for devstack plugin

Deepak Shetty dpkshetty at gmail.com
Wed Mar 25 07:16:43 UTC 2015

On Wed, Mar 25, 2015 at 11:29 AM, Deepak Shetty <dpkshetty at gmail.com> wrote:

> On Wed, Mar 25, 2015 at 12:58 AM, Ian Wienand <iwienand at redhat.com> wrote:
>> On 03/24/2015 03:17 PM, Deepak Shetty wrote:
>> > For eg: Look at [1]
>> > [1]
>> https://github.com/stackforge/devstack-plugin-glusterfs/blob/master/devstack/settings
>> > I would like ability to change these while I use the enable_plugin
>> > apporach to setup devstack w/ GlusterFS per my local glusterfs setup
>> So I think the plugin should do
>> i.e. provide a default only if the variable is unset.
> Bah! That was easy, i should have figured that myself :)
> Thanks for catching that
>> This seems like one of those "traps for new players" and is one
>> concern I have with devstack plugins -- that authors keep having to
>> find out lessons learned independently.  I have added a note on this
>> to the documentation in [1].
>> -i
>> [1] https://review.openstack.org/#/c/167375/
> Great, i +1'ed it.
> Also i posted patch to fix settings file @
> https://review.openstack.org/167494

   Looks like usign bash default in settings file of plugin is not working,
in my patch it didn't use glusterfs driver, it used LVM (default)
I think whats happening here is that by the time settings file is sourced,
CINDER_ENABLED_BACKENDS is already set to lvm by lib/cinder
so settings file's default value is never taken

IIUC there are 3 scenarios (taking CINDER_ENABLED_BACKENDS as example var) :

1) localrc doesn't have CINDER_ENABLED_BACKENDS and enable_plugin
    - Here we want the lib/cinder's default value to be taken
    - this should work fine

2) localrc doesn't have CINDER_ENABLED_BACKENDS but has enable_plugin
    - Here we want the plugin's default values to be taken, but its not as
lib/cinder already initialized CINDER_ENABLED_BACKENDS to use lvm backend
    - Thus broken

3) localrc has both CINDER_ENABLED_BACKENDS and enable_plugin glusterfs
    - Here we want CINDER_ENABLED_BACKENDS present in my localrc to be
    - This will work as by the time settings file is sourced
CINDER_ENABLED_BACKENDS is already initialised to my value in localrc

So #2 scenario would need some changes in stack.sh handling of plugin code ?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150325/6f04906d/attachment.html>

More information about the OpenStack-dev mailing list