[openstack-dev] [tricircle] About registering and loading a plugin
joehuang at huawei.com
Wed Jun 29 00:36:50 UTC 2016
"Moreover, I tried to load drivers by line "cfg.CONF.nyp.plugins.simple", the console prompts oslo_config.cfg.NoSuchOptError: no such option in group DEFAULT: nyp. The setup.cfg is defined as follows."
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:".
Chaoyi Huang ( joehuang )
From: Yipei Niu [newypei at gmail.com]
Sent: 28 June 2016 22:05
To: OpenStack Development Mailing List (not for usage questions)
Cc: joehuang; Vega Cai; skinjo at redhat.com; 金城 忍
Subject: Re: [tricircle] About registering and loading a plugin
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 https://review.openstack.org/#/c/331638/.
Moreover, I tried to load drivers by line "cfg.CONF.nyp.plugins.simple", the console prompts oslo_config.cfg.NoSuchOptError: no such option in group DEFAULT: nyp. The setup.cfg is defined as follows.
simple = nyp.plugins.simple:SimpleFormatter
plain = nyp.plugins.simple:SimpleFormatter
field = nyp.plugins.field:FieldList
How to solve the problem?
On Tue, Jun 28, 2016 at 10:35 AM, Vega Cai <luckyvega.g at gmail.com<mailto:luckyvega.g at gmail.com>> wrote:
You can also refer to my network type driver implementation:
Type driver is registered in setup.cfg and loaded by code.
On 27 June 2016 at 21:44, Yipei Niu <newypei at gmail.com<mailto:newypei at gmail.com>> wrote:
Recently, I learn to name a plugin based on the doc http://docs.openstack.org/developer/stevedore/tutorial/naming.html#. 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?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the OpenStack-dev