<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 18, 2016 at 8:36 AM, reedip banerjee <span dir="ltr"><<a href="mailto:reedip14@gmail.com" target="_blank">reedip14@gmail.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">Dear All Neutron Developers and Reviewers,<div><br></div><div>I have a query/concern related to the parsing of options in python-neutronclient.</div><div>I would like to bring this up, as it "may" also impact the transition of the CLIs to the openstack client as well.</div><div><br></div><div>NeutronClient is pretty special in its behavior, and has one pretty powerful feature of parsing extra options. This feature states that, if the CLI does not support an option but the API does, and the user passes a value for this option, then the "unsupported" CLI option is parsed , and forwarded to the Neutron Server for processing.</div><div><br></div><div>Example:</div><div>Currently "neutron net-create" does not support --router:external. If you see the output of "neutron net-create -h" you would not find "--router-external". However, this option is supported in the API since Juno [2]. So therefore , if a user executes the following CLI <br></div><div><i>" neutron net-create TestNetwork --router-external" </i></div><div><br></div><div>then [1] would be observed as an output. </div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>Now the query/concern comes next....</div><div>Any option which is not supported by the CLI is open to the above parsing.</div><div>Therefore , for net-create and net-update, all the following are possible:</div><div><br></div><div><i>neutron net-create --router:external=True TESTNetwork --(A)<br></i></div><div><i>neutron net-create --router:external TESTNetwork  --(B)</i><i><br></i></div><div><i>neutron net-create </i><i>TESTNetwork </i><i>--router:external </i><i>--(C)</i></div><div><i>neutron net-create </i><i>TESTNetwork </i><i>--router:external=True </i><i>--(D)</i><i><br></i></div><div><i>neutron net-create </i><i>TESTNetwork </i><i>--router:external True </i><i>--(E)</i><i><br></i></div><div><p style="white-space:pre-wrap;color:rgb(0,0,0);font-family:sans-serif">However, user is not aware of the --router:external option because it is not visible in the HELP section ( this is true for other CLI options as well).</p><p style="white-space:pre-wrap;color:rgb(0,0,0);font-family:sans-serif">In order to demonstrate these options to the User, we have to update add_known_arguments function to display them. And once they are known to the CLI, the parsing changes, and some of the options from (A) to (E) may not be supported ( Please see [3] for an ongoing, though now dormant, discussion ). </p><p style="white-space:pre-wrap;color:rgb(0,0,0);font-family:sans-serif">Note that this discussion is not limited only to net-create, but possibly other CLIs as well which do not completely expose the Options which the API can support.I am , however, taking the<i> net-create</i> example as a case-study.</p><p style="white-space:pre-wrap;color:rgb(0,0,0);font-family:sans-serif">I would like to know how we can move forward in this regards:</p><p style="white-space:pre-wrap;color:rgb(0,0,0);font-family:sans-serif">-- Should NeutronClient continue to support all options from (A) to (E), but deprecate some of them in Openstack Client?<br></p></div></div></blockquote><div>The current behavior could be misleading as one is able to provide an option which is not shown in the help.. IMO, we should only accept an option which the CLI say's it can support for 'Create/Update' at-least. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><p style="white-space:pre-wrap;color:rgb(0,0,0);font-family:sans-serif"></p><p style="white-space:pre-wrap;color:rgb(0,0,0);font-family:sans-serif">-- Should we deprecate them in NeutronClient itself, so that the users are comfortable with the options when the migration to Openstack Client occurs?</p></div></div></blockquote><div>I am not sure whether we should keep a behavior which itself looks wrong.. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><p style="white-space:pre-wrap;color:rgb(0,0,0);font-family:sans-serif">-- Any other suggestions....</p><p style="white-space:pre-wrap;color:rgb(0,0,0);font-family:sans-serif"><span style="font-family:arial,sans-serif;color:rgb(34,34,34)">[1]: <a href="http://paste.openstack.org/show/491032/" target="_blank">http://paste.openstack.org/show/491032/</a></span></p><p style="white-space:pre-wrap;color:rgb(0,0,0);font-family:sans-serif"><span style="font-family:arial,sans-serif;color:rgb(34,34,34)">[2]: <a href="http://docs.openstack.org/juno/install-guide/install/apt/content/neutron_initial-external-network.html" target="_blank">http://docs.openstack.org/juno/install-guide/install/apt/content/neutron_initial-external-network.html</a></span></p></div><div><div>[3]: <a href="https://review.openstack.org/#/c/137279/" target="_blank">https://review.openstack.org/#/c/137279/</a></div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div>Thanks and Regards,<br>Reedip Banerjee</div><div>IRC: reedip</div><div><br></div><div><br><br><br></div></div></div></div></div>
</font></span></div></div>
<br>__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div></div>