Description

The error "'module' object has no attribute 'name'" is thrown after configuring auth = [ldap_login] in wikiconfig.py

Steps to reproduce

Add the following to wikiconfig.py

Restart the Wiki and visit in web browser

Example

--> -->

AttributeError

'module' object has no attribute 'name'

If you want to report a bug, please save this page and attach it to your bug report.

Traceback

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

  1. /home/osswww/wiki/packages/moin/lib/python2.5/site-packages/MoinMoin/request/request_standalone.py in __init__ (self=<MoinMoin.request.request_standalone.Request object at 0x2a97525ed0>, sa=<MoinMoin.server.server_standalone.MoinRequestHandler instance at 0x2a97524e18>, properties={})

    1. 58 ##self.debugEnvironment(sa.headers)
    2. 59
    3. 60 RequestBase.__init__(self, properties)
    4. 61
    5. 62 except Exception, err:
    • global RequestBase = <class 'MoinMoin.request.RequestBase'>
    • RequestBase.__init__ = <unbound method RequestBase.__init__>
    • self = <MoinMoin.request.request_standalone.Request object at 0x2a97525ed0>
    • properties = {}
  2. /home/osswww/wiki/packages/moin/lib/python2.5/site-packages/MoinMoin/request/__init__.py in __init__ (self=<MoinMoin.request.request_standalone.Request object at 0x2a97525ed0>, properties={})

    1. 164 self.__dict__.update(properties)
    2. 165 try:
    3. 166 self._load_multi_cfg()
    4. 167 except error.NoConfigMatchedError:
    5. 168 self.makeForbidden(404, 'No wiki configuration matching the URL found!\r\n')
    • self = <MoinMoin.request.request_standalone.Request object at 0x2a97525ed0>
    • self._load_multi_cfg = <bound method Request._load_multi_cfg of <MoinMo...quest_standalone.Request object at 0x2a97525ed0>>
  3. /home/osswww/wiki/packages/moin/lib/python2.5/site-packages/MoinMoin/request/__init__.py in _load_multi_cfg (self=<MoinMoin.request.request_standalone.Request object at 0x2a97525ed0>)

    1. 359 if not hasattr(self, 'cfg'):
    2. 360 self.clock.start('load_multi_cfg')
    3. 361 self.cfg = multiconfig.getConfig(self.url)
    4. 362 self.clock.stop('load_multi_cfg')
    5. 363
    • self = <MoinMoin.request.request_standalone.Request object at 0x2a97525ed0>
    • self.cfg undefined
    • global multiconfig = <module 'MoinMoin.config.multiconfig' from '/hom...5/site-packages/MoinMoin/config/multiconfig.pyc'>
    • multiconfig.getConfig = <function getConfig at 0x2a97519aa0>
    • self.url = 'ossws-tst.corp.hp.com:8888/'
  4. /home/osswww/wiki/packages/moin/lib/python2.5/site-packages/MoinMoin/config/multiconfig.py in getConfig (url='ossws-tst.corp.hp.com:8888/')

    1. 206 cfg = _config_cache[cfgName]
    2. 207 except KeyError:
    3. 208 cfg = _makeConfig(cfgName)
    4. 209 cfg = _config_cache.setdefault(cfgName, cfg)
    5. 210 return cfg
    • cfg undefined
    • global _makeConfig = <function _makeConfig at 0x2a97519230>
    • cfgName = 'wikiconfig'
  5. /home/osswww/wiki/packages/moin/lib/python2.5/site-packages/MoinMoin/config/multiconfig.py in _makeConfig (name='wikiconfig')

    1. 167 found_names = []
    2. 168 for auth in cfg.auth:
    3. 169 if not auth.name:
    4. 170 raise error.ConfigurationError("Auth methods must have a name.")
    5. 171 if auth.name in found_names:
    • auth = <module 'MoinMoin.auth.ldap_login' from '/home/o...on2.5/site-packages/MoinMoin/auth/ldap_login.py'>
    • auth.name undefined

AttributeError

'module' object has no attribute 'name'

  • args = ("'module' object has no attribute 'name'",)
  • message = "'module' object has no attribute 'name'"

System Details

  • Date: Fri, 01 Aug 2008 13:33:59 +0000
  • Platform: Linux g1t0248 2.6.5-7.244-smp #1 SMP Mon Dec 12 18:32:25 UTC 2005 x86_64
  • Python: Python 2.5.2 (/home/osswww/wiki/packages/python/bin/python)
  • MoinMoin: Release 1.7.1 (release)
trace.html

Component selection

Details

trace.html

It appears that the attributes

are defined within the class LDAPAuth and not at the module level and so are not visible when the following code in multiconfig.py is executed:

}}}

Workaround

Discussion

Plan


CategoryMoinMoinNoBug

MoinMoin: MoinMoinBugs/LdapLoginMissingAttributeName (last edited 2008-08-01 18:34:31 by ThomasWaldmann)