brett | 11 Jul 2006 02:03
Picon

exceptions.AttributeError: 'str' object has no attribute 'has_key'

Hi folks:
When I run "buildbot start ." on my buildmaster, I receive this error
in twistd.log:

2006/07/10 15:43 PDT [-] error during loadConfig
2006/07/10 15:43 PDT [-] Traceback (most recent call last):
          File "/usr/lib/python2.3/site-packages/twisted/scripts/twistd.py",
line 182, in startApplication
            app.startApplication(application, not config['no_save'])
          File "/usr/lib/python2.3/site-packages/twisted/application/app.py",
line 298, in startApplication
            service.IService(application).startService()
          File "/usr/lib/python2.3/site-packages/twisted/application/service.py",
line 196, in startService
            service.startService()
          File "/usr/lib/python2.3/site-packages/buildbot/master.py",
line 630, in startService
            self.loadTheConfigFile()
        --- <exception caught here> ---
          File "/usr/lib/python2.3/site-packages/buildbot/master.py",
line 685, in loadTheConfigFile
            self.loadConfig(f)
          File "/usr/lib/python2.3/site-packages/buildbot/master.py",
line 768, in loadConfig
            if b.has_key('slavename') and b['slavename'] not in slavenames:
        exceptions.AttributeError: 'str' object has no attribute 'has_key'

It looks like master.py is querying a builder dictionary 'b' for the
slavename.  I'm not sure why the exception claims that builder is a
'str' object.
(Continue reading)

Stephen Davis | 11 Jul 2006 06:30
Picon

Re: exceptions.AttributeError: 'str' object has no attribute 'has_key'

I think you have some unnecessary quoting here:

 >>>
b1 = {'name': 'builder1', 'slavename': 'changed3',  
'builddir':'builder1', 'factory': f1}
c['builders'] = ['b1']
 >>>

I think it should be:
c['builders'] = [b1]

hth,
stephen

On Jul 10, 2006, at 5:03 PM, brett wrote:

> Hi folks:
> When I run "buildbot start ." on my buildmaster, I receive this error
> in twistd.log:
>
> 2006/07/10 15:43 PDT [-] error during loadConfig
> 2006/07/10 15:43 PDT [-] Traceback (most recent call last):
>           File "/usr/lib/python2.3/site-packages/twisted/scripts/ 
> twistd.py",
> line 182, in startApplication
>             app.startApplication(application, not config['no_save'])
>           File "/usr/lib/python2.3/site-packages/twisted/ 
> application/app.py",
> line 298, in startApplication
>             service.IService(application).startService()
(Continue reading)


Gmane