From: Ron T. <Ro...@US...> - 2008-06-06 15:24:46
|
Hi David, I had this happen before because I tried to do this: Import aModuleName.py I don't see that mistake in your code though, but maybe something you are calling is doing that. You need to leave off the .py when doing import. Hope that helps, Ron _____ From: pyt...@li... [mailto:pyt...@li...] On Behalf Of David Hlácik Sent: Thursday, June 05, 2008 9:55 AM To: pyt...@li... Subject: Re: module ldap : no module named .py As you can see : Jun 5 13:33:12 dev01 nnrpd[9550]: python: Error: No module named py comes from nnrpd_auth.py : try: if self.__newsauth(str(attributes['user']),str(attributes['pass'])): syslog('notice', 'authentication by username succeeded') return ( self.authcodes['ALLOWED'], 'No error', 'default_user') else: syslog('notice', 'authentication by username failed') return ( self.authcodes['DENIED'], 'Access Denied!') except Exception, e: syslog('notice', "Error: %s" % e) On Thu, Jun 5, 2008 at 3:53 PM, David Hláčik <da...@hl...> wrote: FYI, this is the result of test.py : -- syslog level: notice message: nnrpd authentication class instance created ** set_auth_hook for <nnrpd_auth.AUTH instance at 0xb7f1f5ec> -- syslog level: notice message: authentication module successfully hooked into nnrpd -- syslog level: notice message: nnrpd authentication class instance created -- syslog level: notice message: n_a authenticate() invoked: hostname None, ipaddress None, interface None, user boss -- syslog level: notice message: authentication by username succeeded (281, 'No error', 'default_user') And this is the result (from news.notice) when used as auth hook in INN : (inn will load nnrpd_auth.py and instantiate as in nnrpd_auth.py on the end written and call method authenticate(attributes) ) : Jun 5 13:33:12 dev01 nnrpd[9550]: david-nb.net.hlacik.eu (10.10.10.199) connect Jun 5 13:33:12 dev01 nnrpd[9550]: python interpreter initialized OK Jun 5 13:33:12 dev01 nnrpd[9550]: python: nnrpd authentication class instance created Jun 5 13:33:12 dev01 nnrpd[9550]: python: authentication module successfully hooked into nnrpd Jun 5 13:33:12 dev01 nnrpd[9550]: python method authen_init not found Jun 5 13:33:12 dev01 nnrpd[9550]: python method authen_close not found Jun 5 13:33:12 dev01 nnrpd[9550]: python method access_init not found Jun 5 13:33:12 dev01 nnrpd[9550]: python method access_close not found Jun 5 13:33:12 dev01 nnrpd[9550]: python method dynamic_init not found Jun 5 13:33:12 dev01 nnrpd[9550]: python method dynamic_close not found Jun 5 13:33:12 dev01 nnrpd[9550]: python: n_a authenticate() invoked: hostname david-nb.net.hlacik.eu, ipaddress 10.10.10.199, interface 10.10.10.183, user boss Jun 5 13:33:12 dev01 nnrpd[9550]: python: Error: No module named py Jun 5 13:33:12 dev01 nnrpd[9550]: python authenticate method returned wrong result Jun 5 13:33:12 dev01 nnrpd[9550]: david-nb.net.hlacik.eu times user 0.016 system 0.016 idle 0.000 elapsed 0.073 |