Skip to content

Commit

Permalink
Merge pull request #322 from gracinet/master
Browse files Browse the repository at this point in the history
Fixes #2199. in Bzr hook, make user and password for PB configurable
  • Loading branch information
tomprince committed Feb 11, 2012
2 parents fa393e9 + f771345 commit 3971cc1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion master/contrib/bzr_buildbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
to which you will connect (as of this writing, the same server and port to
which slaves connect)
- buildbot_auth: (optional, defaults to change:changepw) the credentials
expected by the change source configuration in the master. Takes the
"user:password" form.
- buildbot_pqm: (optional, defaults to not pqm) Normally, the user that
commits the revision is the user that is responsible for the change. When
run in a pqm (Patch Queue Manager, see https://launchpad.net/pqm)
Expand Down Expand Up @@ -309,6 +313,7 @@ def _add_change():
HOOK_KEY = 'buildbot_on'
SERVER_KEY = 'buildbot_server'
PORT_KEY = 'buildbot_port'
AUTH_KEY = 'buildbot_auth'
DRYRUN_KEY = 'buildbot_dry_run'
PQM_KEY = 'buildbot_pqm'
SEND_BRANCHNAME_KEY = 'buildbot_send_branch_name'
Expand Down Expand Up @@ -413,8 +418,13 @@ def send_change(branch, old_revno, old_revid, new_revno, new_revid, hook):
reactor.resolver = ThreadedResolver(reactor)
pbcf = twisted.spread.pb.PBClientFactory()
reactor.connectTCP(server, port, pbcf)
auth = config.get_user_option(AUTH_KEY)
if auth:
user, passwd = [s.strip() for s in auth.split(':', 1)]
else:
user, passwd = ('change', 'changepw')
deferred = pbcf.login(
twisted.cred.credentials.UsernamePassword('change', 'changepw'))
twisted.cred.credentials.UsernamePassword(user, passwd))

def sendChanges(remote):
"""Send changes to buildbot."""
Expand Down

0 comments on commit 3971cc1

Please sign in to comment.