<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 25, 2015 at 3:58 PM, Sean Dague <span dir="ltr"><<a href="mailto:sean@dague.net" target="_blank">sean@dague.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 03/25/2015 03:16 AM, Deepak Shetty wrote:<br>
><br>
><br>
> On Wed, Mar 25, 2015 at 11:29 AM, Deepak Shetty <<a href="mailto:dpkshetty@gmail.com">dpkshetty@gmail.com</a><br>
</span><span class="">> <mailto:<a href="mailto:dpkshetty@gmail.com">dpkshetty@gmail.com</a>>> wrote:<br>
><br>
><br>
><br>
>     On Wed, Mar 25, 2015 at 12:58 AM, Ian Wienand <<a href="mailto:iwienand@redhat.com">iwienand@redhat.com</a><br>
</span><div><div class="h5">>     <mailto:<a href="mailto:iwienand@redhat.com">iwienand@redhat.com</a>>> wrote:<br>
><br>
>         On 03/24/2015 03:17 PM, Deepak Shetty wrote:<br>
>         > For eg: Look at [1]<br>
>         > [1] <a href="https://github.com/stackforge/devstack-plugin-glusterfs/blob/master/devstack/settings" target="_blank">https://github.com/stackforge/devstack-plugin-glusterfs/blob/master/devstack/settings</a><br>
><br>
>         > I would like ability to change these while I use the enable_plugin<br>
>         > apporach to setup devstack w/ GlusterFS per my local glusterfs setup<br>
><br>
>         So I think the plugin should do<br>
><br>
>         CINDER_ENABLED_BACKENDS=${CINDER_ENABLED_BACKENDS:-glusterfs:glusterfs,lvm:lvm1}<br>
><br>
>         i.e. provide a default only if the variable is unset.<br>
><br>
><br>
>     Bah! That was easy, i should have figured that myself :)<br>
>     Thanks for catching that<br>
><br>
><br>
><br>
>         This seems like one of those "traps for new players" and is one<br>
>         concern I have with devstack plugins -- that authors keep having to<br>
>         find out lessons learned independently.  I have added a note on this<br>
>         to the documentation in [1].<br>
><br>
>         -i<br>
><br>
>         [1] <a href="https://review.openstack.org/#/c/167375/" target="_blank">https://review.openstack.org/#/c/167375/</a><br>
><br>
><br>
>     Great, i +1'ed it.<br>
><br>
>     Also i posted patch to fix settings file @<br>
>     <a href="https://review.openstack.org/167494" target="_blank">https://review.openstack.org/167494</a><br>
><br>
><br>
> Ian,<br>
>    Looks like usign bash default in settings file of plugin is not<br>
> working, in my patch it didn't use glusterfs driver, it used LVM (default)<br>
> I think whats happening here is that by the time settings file is<br>
> sourced, CINDER_ENABLED_BACKENDS is already set to lvm by lib/cinder<br>
> so settings file's default value is never taken<br>
><br>
> IIUC there are 3 scenarios (taking CINDER_ENABLED_BACKENDS as example var) :<br>
><br>
> 1) localrc doesn't have CINDER_ENABLED_BACKENDS and enable_plugin<br>
>     - Here we want the lib/cinder's default value to be taken<br>
>     - this should work fine<br>
><br>
> 2) localrc doesn't have CINDER_ENABLED_BACKENDS but has enable_plugin<br>
> glusterfs<br>
>     - Here we want the plugin's default values to be taken, but its not<br>
> as lib/cinder already initialized CINDER_ENABLED_BACKENDS to use lvm backend<br>
>     - Thus broken<br>
><br>
> 3) localrc has both CINDER_ENABLED_BACKENDS and enable_plugin glusterfs<br>
> specified<br>
>     - Here we want CINDER_ENABLED_BACKENDS present in my localrc to be<br>
> chosen<br>
>     - This will work as by the time settings file is sourced<br>
> CINDER_ENABLED_BACKENDS is already initialised to my value in localrc<br>
><br>
> So #2 scenario would need some changes in stack.sh handling of plugin code ?<br>
<br>
</div></div>Right, so this code runs late enough that you don't get to change the<br>
defaults. I think that's ok.<br></blockquote><div><br></div><div>Had a question here, why is this source in the end ?<br></div><div><br>plugin config is something that should be allowed to be overridden, thus this should<br></div><div>be sourced in the beginning and then anything in localrc will override what the plugin <br></div><div>sets/unsets<br><br></div><div>That ways if someone wants to use plugin config, just enable the plugin.<br></div><div>if they want to override, enable plugin and override the env specific parts<br><br></div><div>Am i thinkign wrong ?<br></div><div><br></div><div>thanx,<br></div><div>deepak<br></div></div><br></div></div>