<div dir="ltr">Hi Vitaly,<div><br></div><div>I agree with you that conditions can be useful in case of complicated plugins, but</div><div>at the same time in case of simple cases it adds a huge amount of complexity.</div><div>I would like to avoid forcing user to know about any conditions if he wants</div><div>to add several text fields on the UI.</div><div><br></div><div>I have several reasons why we shouldn't do that:</div><div>1. conditions are described with yet another language with it's own syntax</div><div>2. the language is not documented (solvable)</div><div>3. complicated interface will lead to a lot of bugs for the end user, and it will be</div><div>    a Fuel team's problem</div><div>4. in case of several checkboxes you'll have to write a huge conditions with</div><div>    a lot of "and" statements and it'll be really easy to forget about some of them</div><div><br></div><div>As result in simple cases plugin developer will have to specify the same</div><div>condition of every task in tasks.yaml file, add it to metadata.yaml.</div><div>If you add new checkbox, you should go through all of this files,</div><div>add "and lbaas:new_checkbox_name" statement.</div><div><br></div><div>Thanks,</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 27, 2014 at 7:57 PM, Vitaly Kramskikh <span dir="ltr"><<a href="mailto:vkramskikh@mirantis.com" target="_blank">vkramskikh@mirantis.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Folks,<br><br></div>In the 6.0 release we'll support simple plugins for Fuel. The current architecture allows to create only very simple plugins and doesn't allow to "pluginize" complex features like Ceph, vCenter, etc. I'd like to propose some changes to make it possible. They are subtle enough and the plugin template still can be autogenerated by Fuel Plugin Builder. Here they are:<br><br><a href="https://github.com/vkramskikh/fuel-plugins/commit/1ddb166731fc4bf614f502b276eb136687cb20cf" target="_blank">https://github.com/vkramskikh/fuel-plugins/commit/1ddb166731fc4bf614f502b276eb136687cb20cf</a><br><div><div><ol><li><span title="lbaas/environment_config.yaml">environment_config.yaml should contain exact config which will be mixed into cluster_attributes. No need to implicitly generate any controls like it is done now.<br></span></li><li><span title="lbaas/metadata.yaml">metadata.yaml should also contain "is_removable" field. </span><span title="lbaas/metadata.yaml"><span title="lbaas/metadata.yaml">This field is needed to 
determine whether it is possible to remove installed plugin. It is 
impossible to remove plugins in the current implementation.</span> This field should contain an expression written in our DSL which we already use in a few places. The LBaaS plugin also uses it to hide the checkbox if Neutron is not used, so even simple plugins like this need to utilize it. This field can also be autogenerated, for more complex plugins plugin writer needs to fix it manually. For example, for Ceph it could look like "settings:storage.volumes_ceph.value == false and settings:storage.images_ceph.value == false".<br></span></li><li><span title="lbaas/metadata.yaml">For every task in </span><span title="lbaas/tasks.yaml">tasks.yaml there should be added new "condition" field with an expression which determines whether the task should be run. In the current implementation tasks are always run for specified roles. For example, vCenter plugin can have a few tasks with conditions like "settings:common.libvirt_type.value == 'vcenter'" or "settings:storage.volumes_vmdk.value == true". Also, AFAIU, similar approach will be used in implementation of Granular Deployment feature.<br></span></li></ol><p>These simple changes will allow to write much more complex plugins. What do you think?<span class="HOEnZb"><font color="#888888"><br></font></span></p><span class="HOEnZb"><font color="#888888">-- <br><div><div dir="ltr">Vitaly Kramskikh,<br>Software Engineer,<br>Mirantis, Inc.</div></div>
</font></span></div></div></div>
<br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div>