<div dir="ltr"><div><div>It may be better to attach setup.cfg you using, and paste traceback (if there).<br><br></div>Cheers,<br></div>Shinobu<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 29, 2016 at 4:57 PM, Yipei Niu <span dir="ltr"><<a href="mailto:newypei@gmail.com" target="_blank">newypei@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">Hi all,<div><br></div><div>I have succeed in registering a config option and obtaining it. So how to load an option from a customized file? Through cfg.CONF(default_config_files=[setup.cfg]? Still fails loading the config options in setup.cfg.</div><div><br></div><div>Best regards,</div><div>Yipei</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 29, 2016 at 8:36 AM, joehuang <span dir="ltr"><<a href="mailto:joehuang@huawei.com" target="_blank">joehuang@huawei.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">
<p>Hi, Yipei,</p><span class=""><span>
<p> </p>
<div>"Moreover, I tried to load drivers by line "<font face="Menlo" color="black" size="2"><span style="BACKGROUND-COLOR:white;FONT-SIZE:9pt">cfg.CONF.nyp.plugins.</span></font><font face="Menlo" color="black" size="2"><span style="BACKGROUND-COLOR:white;FONT-SIZE:9pt">simple</span></font>",
 the console prompts oslo_config.cfg.NoSuchOptError: no such option in group DEFAULT: nyp. The setup.cfg is defined as follows."</div>
<div> </div>
</span></span><div>You are using entry point but not configuration options for plugin discovery, and no config option you have registered in oslo_config.cfg, so " no such option in group DEFAULT:".</div><span>
<div> </div>
<div>Best Regards</div>
<div>Chaoyi Huang ( joehuang )</div>
<div> </div>
</span><div style="FONT-FAMILY:Times New Roman;COLOR:#000000;FONT-SIZE:16px">
<hr>
<div style="DIRECTION:ltr"><font face="Tahoma" color="#000000" size="2"><b>From:</b> Yipei Niu [<a href="mailto:newypei@gmail.com" target="_blank">newypei@gmail.com</a>]<br>
<b>Sent:</b> 28 June 2016 22:05<span><br>
<b>To:</b> OpenStack Development Mailing List (not for usage questions)<br>
</span><b>Cc:</b> joehuang; Vega Cai; <a href="mailto:skinjo@redhat.com" target="_blank">skinjo@redhat.com</a>; 金城 忍<br>
<b>Subject:</b> Re: [tricircle] About registering and loading a plugin<br>
</font><br>
</div><div><div class="h5"><div><div>
<div></div>
<div>
<div dir="ltr">Hi all,
<div><br>
</div>
<div>Thanks a lot for your valuable advice. I have already succeed in registering and loading a self-defined plugin. The entry_point is generated by executing setup.py, and found in .egg-info/entry_points.txt, which is different from using setup.cfg in <a style="FONT-SIZE:13px" href="https://review.openstack.org/#/c/331638/" target="_blank">https://review.openstack.org/#/c/331638/</a>. </div>
<div><br>
</div>
<div>Moreover, I tried to load drivers by line "<span style="BACKGROUND-COLOR:rgb(255,255,255)"><font color="#000000"><span style="FONT-FAMILY:Menlo;FONT-SIZE:9pt">cfg.CONF.nyp.plugins.</span><span style="FONT-FAMILY:Menlo;FONT-SIZE:9pt">simple</span></font></span>",
 the console prompts oslo_config.cfg.NoSuchOptError: no such option in group DEFAULT: nyp. The setup.cfg is defined as follows.</div>
<div>
<pre style="BACKGROUND-COLOR:rgb(43,43,43);FONT-FAMILY:Menlo;COLOR:rgb(169,183,198);FONT-SIZE:9pt">[entry_points]<br>nyp.plugins.formmater =<br>    simple = nyp.plugins.simple:SimpleFormatter<br>    plain = nyp.plugins.simple:SimpleFormatter<br>    field = nyp.plugins.field:FieldList</pre>
</div>
<div>How to solve the problem?</div>
<div><br>
</div>
<div>Best regards,</div>
<div>Yipei</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Jun 28, 2016 at 10:35 AM, Vega Cai <span dir="ltr">
<<a href="mailto:luckyvega.g@gmail.com" target="_blank">luckyvega.g@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">
<div dir="ltr">Hi Yipei,
<div><br>
</div>
<div>You can also refer to my network type driver implementation:</div>
<div><br>
</div>
<div><a href="https://review.openstack.org/#/c/331638/" target="_blank">https://review.openstack.org/#/c/331638/</a><br>
</div>
<div><br>
</div>
<div>Type driver is registered in setup.cfg and loaded by code.</div>
<div><br>
</div>
<div>BR</div>
<div>Zhiyuan</div>
</div>
<div>
<div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On 27 June 2016 at 21:44, Yipei Niu <span dir="ltr"><<a href="mailto:newypei@gmail.com" target="_blank">newypei@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">
<div dir="ltr">Dear all,
<div><br>
</div>
<div>Recently, I learn to name a plugin based on the doc <a href="http://docs.openstack.org/developer/stevedore/tutorial/naming.html#" target="_blank">
http://docs.openstack.org/developer/stevedore/tutorial/naming.html#</a>. I define a new entry_point for the plugin, then it fails. The console prompts "stevedore.exception.NoMatches: No 'net.nyp.formatter' driver found, looking for 'simple'". After setting
 a new entry_point with setuptools, why stevedore cannot find the driver based on the entry_point?</div>
<div><br>
</div>
<div>Best regards,</div>
<div>Yipei</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div></div></div></div></div>
</div>
</div>

</blockquote></div><br></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Email:<br><a href="mailto:shinobu@linux.com" target="_blank">shinobu@linux.com</a><br><a href="mailto:shinobu@redhat.com" target="_blank">shinobu@redhat.com</a></div>
</div>