[Kimchi-devel] [PATCH] [WoK] Fixing loading of the 'Ginger' plug-in

Daniel Henrique Barboza dhbarboza82 at gmail.com
Mon Jan 25 11:14:05 UTC 2016


I've found out the real error. Let me resend the patch

On 01/25/2016 09:01 AM, Aline Manera wrote:
> I also was looking at the wok code and the exception about sub_nodes 
> is not raised, just logged into log files.
>
> In src/wok/server.py
>
>            # dynamically add tools.wokauth.on = True to extra plugin APIs
> try:
>                 sub_nodes = import_class('plugins.%s.control.sub_nodes' %
> plugin_name)
>             except ImportError, e:
> cherrypy.log.error_log.error(
>                     "Failed to import subnodes for plugin %s, "
>                     "error: %s" % (plugin_class, e.message)
> )
>                 continue
>
> So the presence or not of sub_nodes should not block the plugin to be 
> loaded.
>
> On 01/25/2016 08:47 AM, Aline Manera wrote:
>>
>> Hi Daniel,
>>
>> We should consider the file structure for all the plugins.
>> Otherwise, wok will be unmanageable.
>>
>> What about rename the controls dir to control?
>>
>> Regards,
>> Aline Manera
>>
>> On 01/24/2016 12:03 PM, dhbarboza82 at gmail.com wrote:
>>> From: Daniel Henrique Barboza <dhbarboza82 at gmail.com>
>>>
>>> Recent WoK changes were made considering that all WoK plug-ins
>>> have the control modules in a dir named 'control', but
>>> Ginger, for historical/unknown reasons, uses the dir
>>> 'controls'. The result is that WoK became unable of loading
>>> Ginger. This patch amends it.
>>>
>>> It is needed to change both 'controls' and 'models' Ginger
>>> dirs to 'control' and 'model' so Ginger can be compliant
>>> with the rest of WoK plug-ins. Until then, WoK will need
>>> to consider this awkward Ginger design when doing plug-in wide
>>> changes like the one made.
>>>
>>> Signed-off-by: Daniel Henrique Barboza <dhbarboza82 at gmail.com>
>>> ---
>>>   src/wok/server.py | 9 +++++++--
>>>   1 file changed, 7 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/src/wok/server.py b/src/wok/server.py
>>> index 4fd380c..42a88f7 100644
>>> --- a/src/wok/server.py
>>> +++ b/src/wok/server.py
>>> @@ -170,8 +170,13 @@ class Server(object):
>>>
>>>               # dynamically add tools.wokauth.on = True to extra 
>>> plugin APIs
>>>               try:
>>> -                sub_nodes = 
>>> import_class('plugins.%s.control.sub_nodes' %
>>> -                                         plugin_name)
>>> +                # FIXME when Ginger padronizes its dir names.
>>> +                if plugin_name != 'ginger':
>>> +                    sub_nodes = 
>>> import_class('plugins.%s.control.sub_nodes' %
>>> +                                             plugin_name)
>>> +                else:
>>> +                    sub_nodes = 
>>> import_class('plugins.%s.controls.sub_nodes' %
>>> +                                             plugin_name)
>>>               except ImportError, e:
>>>                   cherrypy.log.error_log.error(
>>>                       "Failed to import subnodes for plugin %s, "
>>
>> _______________________________________________
>> Kimchi-devel mailing list
>> Kimchi-devel at ovirt.org
>> http://lists.ovirt.org/mailman/listinfo/kimchi-devel
>>
>




More information about the Kimchi-devel mailing list