[Buildbot-devel] MailNotifier lookup for alien SVN users

Christian Unger christian.unger at me.com
Mon Jan 17 15:56:42 UTC 2011


this may be clumsy but hey, it works:

class userMapper:
	"""A class used to map user names to email addresses.
	It is used by the buildbot to send blame emails.
	We use this currently instead of the directoryMapper class.
	Which will perform ldap lookups."""

	from buildbot import interfaces
	if implements:
		implements( interfaces.IEmailLookup )
	else:
		__implements__ = interfaces.IEmailLookup,

	def getAddress( self, user ):
		"""Look up the user and return their email address."""

		usermap = {'internal1':'internal1',
				'internal2':'internal2',
				'internal3':'internal3.name3'}

		externalusermap={'external1':'external1 at some.domain.com'}

		if usermap.has_key(user):
			return usermap[user] + "@" + "internal.domain.com"
		elif externalusermap.has_key(user):
			return externalusermap[user]












On 17.01.2011, at 16:21, Mark Richardson (Internal) wrote:

> Hello fellow buildbot users,
> I am using buildbot 0.8.2 and would like to know how to map from the 
> user-names of SVN changers to their real world identity.
> 
> The users are added by Trac Admin to an HTTP Digest method that is also 
> used by SVN for the commits. They can be any of 10 separate institutes 
> (and increasing). At the moment I use my own email as the notification
> of the build success/failure. "sendToInterestedUsers" is set to false 
> for now.
> 
> As I have a MySQL db I believe that when the trac admin adds a user
> their email is added to mysql and the password is updated in the
> htpasswd.auth file.
> 
> I wonder how to get the "trac" mysql data across to the buildbot mysql
> or into buildbot. I do not feel confident enough with Python to write
> my own "lookup" entity. Should I create several email notifiers (one
> for each institute?). Perhaps the mysql database should have been
> common to buildbot and trac?
> 
> Cheers,
> Mark
> -- 
> Mark Richardson, Ph.D. HECToR CSE, Mobile: 07525 238037
>     NAG Manchester, Peter House, Oxford Street,  Manchester, M1 5AN
> Head office at:
>     Numerical Algorithms Group Ltd, Wilkinson House,
>     Jordan Hill Business park, Oxford OX2 8DR
> ----------------------------------------------------------------
> 
> 
> ________________________________________________________________________
> The Numerical Algorithms Group Ltd is a company registered in England
> and Wales with company number 1249803. The registered office is:
> Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
> 
> This e-mail has been scanned for all viruses by Star. The service is
> powered by MessageLabs. 
> ________________________________________________________________________
> 
> ------------------------------------------------------------------------------
> Protect Your Site and Customers from Malware Attacks
> Learn about various malware tactics and how to avoid them. Understand 
> malware threats, the impact they can have on your business, and how you 
> can protect your company and customers by using code signing.
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel


--
christian unger • pferdeweide  47 • 22589 hamburg, germany
-------------------------------------------------------------------------------
fon +49 16090987304
fon +49 4097073763 • fax +49 4097073765
--------------------------------------------------------------------
aim christian_unger at mac.com
skype c_unger








More information about the devel mailing list