[Buildbot-devel] IEmailLookup asserton error

Alexander O'Donovan-Jones Alexander at ccpgames.com
Fri Apr 16 11:12:13 UTC 2010


Do you have 'from zope.interface import implements' at the top? It's a function afterall.
I can't get your code to run in my 2.5.4 console without changing __implements__ to implements and including the import from zope.interface

Once I do that, however, 'the interfaces.IEmailLookup.providedBy(lookup)' returns True

-----Original Message-----
From: Roth, Pierre [mailto:pierre.roth at covidien.com] 
Sent: Friday, April 16, 2010 11:04 AM
To: Alexander O'Donovan-Jones; buildbot-devel at lists.sourceforge.net
Subject: RE: IEmailLookup asserton error

I used  __implements__ = interfaces.IEmailLookup
Because using implements(interfaces.IEmailLookup) gives me the following error:

Traceback (most recent call last):
  File "D:\Python25\lib\site-packages\buildbot-0.7.12-py2.5.egg\buildbot\scripts
\runner.py", line 990, in doCheckConfig
    ConfigLoader(configFileName=configFileName)
  File "D:\Python25\lib\site-packages\buildbot-0.7.12-py2.5.egg\buildbot\scripts
\checkconfig.py", line 32, in __init__
    self.loadConfig(configFile)
  File "D:\Python25\lib\site-packages\buildbot-0.7.12-py2.5.egg\buildbot\master.
py", line 506, in loadConfig
    exec f in localDict
  File "E:\serv\buildbots\pb5XX\master\master.cfg", line 309, in <module>
    class MyEmailLookup:
  File "E:\serv\buildbots\pb5XX\master\master.cfg", line 311, in MyEmailLookup
    implements(interfaces.IEmailLookup)
NameError: name 'implements' is not defined



-----Message d'origine-----
De : Alexander O'Donovan-Jones [mailto:Alexander at ccpgames.com] 
Envoyé : vendredi 16 avril 2010 13:01
À : Roth, Pierre; buildbot-devel at lists.sourceforge.net
Objet : RE: IEmailLookup asserton error

Looking at the code for the Domain class in my version (0.7.12) the 'implements' syntax is different to that you've shown, using 
	implements(interfaces.IEmailLookup)
rather than 
	__implements__ = interfaces.IEmailLookup

Could this be causing your error? 

-----Original Message-----
From: Roth, Pierre [mailto:pierre.roth at covidien.com]
Sent: Friday, April 16, 2010 10:56 AM
To: Alexander O'Donovan-Jones; buildbot-devel at lists.sourceforge.net
Subject: RE: IEmailLookup asserton error

Hi,

Thanks for your quick reply but this does not cover my use case since my  VC system does not use the same usernames as my email system.

I really would like to have this lookup class work. There's obviously something wrong in my code since I get an assretion error...

Do you have another example? 

Thanks

Pierre
-----Message d'origine-----
De : Alexander O'Donovan-Jones [mailto:Alexander at ccpgames.com] Envoyé : vendredi 16 avril 2010 12:50 À : Roth, Pierre; buildbot-devel at lists.sourceforge.net
Objet : RE: IEmailLookup asserton error

If you're sending to a specific domain, you don't even need to do that. Buildbot has the Domain class for that reason This is paraphrased from my codebase:

	from buildbot.status import mail

	def assetsEmail(mode, name, build, results, master_status):
		# this is used to pull some logs and make an email to send
		pass

	lookup = mail.Domain('ccpgames.com')
	notifer = mail.MailNotifier(
		builders = 'foo',
		fromaddr = buildbot at ccpgames.com,
		subject = 'Asset report',
		sendToInterestedUsers = False,
		mode = 'all'
   		extraRecipients = ['alexander at ccpgames.com'],
    		relayhost = ,
    		lookup = lookup,
    		messageFormatter = assetsEmail,
	)

	# add to master cfg
	c['status'].append(notifier)

When a change is processed, the username from the change is parsed out, and the Domain class is combined with to create the email In the form of username at domain

If this doesn't cover what you're after, let me know.

-----Original Message-----
From: Roth, Pierre [mailto:pierre.roth at covidien.com]
Sent: Friday, April 16, 2010 9:09 AM
To: buildbot-devel at lists.sourceforge.net
Subject: [Buildbot-devel] IEmailLookup asserton error

Hi all,

New with buildbot, I'm trying to implement an IEmailLookup class and have an assertion error.

Setup:
 - Windows 2003
 - Python 2.5.4
 - Buildbot 0.7.12
 - Twisted: 10.0.0

Code:
from buildbot import interfaces, util

class MyEmailLookup():
	
    __implements__  = interfaces.IEmailLookup
	
    def __init__(self):
        pass
 	
    def getAdress(self, user):
        result = 'me at mydomain.com'
        if user == 'pierre':
            result = 'pierre.lastname at mydomain.com
        if user == 'manuel':
            result = 'manuel.hislastname at mydomain.com'
        return result

email_lookup = MyEmailLookup()

c['status'].append(mail.MailNotifier(fromaddr="buildbot at mydomain.com",
relayhost="smtp.mydomain.com", lookup = email_lookup))


Traceback (most recent call last):
  File
"D:\Python25\lib\site-packages\buildbot-0.7.12-py2.5.egg\buildbot\script
s
\runner.py", line 990, in doCheckConfig
    ConfigLoader(configFileName=configFileName)
  File
"D:\Python25\lib\site-packages\buildbot-0.7.12-py2.5.egg\buildbot\script
s
\checkconfig.py", line 32, in __init__
    self.loadConfig(configFile)
  File
"D:\Python25\lib\site-packages\buildbot-0.7.12-py2.5.egg\buildbot\master
.
py", line 506, in loadConfig
    exec f in localDict
  File "E:\serv\buildbots\pb5XX\master\master.cfg", line 274, in <module>
 
c['status'].append(mail.MailNotifier(fromaddr="buildbot-airox at covidien.c
om",
 relayhost="mailemea.thcg.net", lookup = email_lookup))
  File
"D:\Python25\lib\site-packages\buildbot-0.7.12-py2.5.egg\buildbot\status
\
mail.py", line 187, in __init__
    assert interfaces.IEmailLookup.providedBy(lookup)
AssertionError


Thanks a lot for your support,

Pierre

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Buildbot-devel mailing list
Buildbot-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/buildbot-devel







More information about the devel mailing list