Re: Func warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, it is not :)

I checked further.
In folder
/usr/lib/python2.4/site-packages/func/overlord/modules

There is a file:
__init__.py

And the function load_modules() of
/usr/lib/python2.4/site-packages/func/module_loader.py is somewhere
called with a path=func/overlord/modules/

In the loop:
for fn in filenames:

when it gets to fn='__init__.py'
it reaches the condition:
if basename[:8] == "__init__":
    modname = dirname

The result is modname = '' (empty string)

Then there is
pathname = modname
(...)
mod_imp_name = pathname.replace("/", ".")

This is the cause of the exception a few lines below in:
blip =  __import__("%s%s" % ( mod_dir,mod_imp_name), globals(),
locals(), [mod_imp_name])

Because mod_imp_name is blank
-> ValueError: Empty module name

For minion-side modules the __init__.py files are in a subfolder named
with the module name.

This is not the case for
/usr/lib/python2.4/site-packages/func/overlord/modules/__init__.py

There is a bug here.

What is the best option ?
- handle this case in the code ?
- catch the exception ?
- delete the __init__.py in overlord modules ? (I don't know if it is required)

Let me know.

Louis


2010/10/7 seth vidal <skvidal@xxxxxxxxxxxxxxxxx>:
> On Wed, 2010-10-06 at 11:57 +0200, Louis Coilliot wrote:
>> Hello,
>>
>> using the python logging module, I see messages appearing in the logs
>> that I didn't have on the console.
>>
>>
>> ['Traceback (most recent call last):\n', ' ÂFile
>> "/usr/lib/python2.4/site-packages/func/module_loader.py", line 97, in
>> load_modules\n  Âblip = Â__import__("%s%s" % ( mod_dir,mod_imp_name),
>> globals(), locals(), [mod_imp_name])\n', 'ValueError: Empty module
>> name\n']
>>
>>
>> This is harmless and I think I could get rid of it with an exception
>> on ValueError, but I'm curious about what it is.
>>
>> Do you also see this, or is it caused by one of my custom func modules ?
>
> custom func module.
>
>
>
> Take them out one by one and you'll find out which one it is.
>
> -sv
>
>
> _______________________________________________
> Func-list mailing list
> Func-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/func-list
>

_______________________________________________
Func-list mailing list
Func-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/func-list



[Index of Archives]     [Fedora Users]     [Linux Networking]     [Fedora Legacy List]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux