[Lsb-messages] /var/www/bzr/lsb/devel/buildbot-config r243: Allow configurable logins for the ChangeSource push client.

Jeff Licquia licquia at linuxfoundation.org
Tue May 1 21:06:50 UTC 2012


------------------------------------------------------------
revno: 243
committer: Jeff Licquia <licquia at linuxfoundation.org>
branch nick: buildbot-config
timestamp: Tue 2012-05-01 17:06:50 -0400
message:
  Allow configurable logins for the ChangeSource push client.
modified:
  bzr_buildbot.py
-------------- next part --------------
=== modified file 'bzr_buildbot.py'
--- a/bzr_buildbot.py	2012-02-11 19:11:35 +0000
+++ b/bzr_buildbot.py	2012-05-01 21:06:50 +0000
@@ -301,6 +301,8 @@
 DRYRUN_KEY = 'buildbot_dry_run'
 PQM_KEY = 'buildbot_pqm'
 SEND_BRANCHNAME_KEY = 'buildbot_send_branch_name'
+LOGIN_KEY = 'buildbot_login'
+PASSWD_KEY = 'buildbot_password'
 
 PUSH_VALUE = 'push'
 COMMIT_VALUE = 'commit'
@@ -371,11 +373,18 @@
 def send_change(branch, old_revno, old_revid, new_revno, new_revid, hook):
     config = branch.get_config()
     server = config.get_user_option(SERVER_KEY)
+    login = config.get_user_option(LOGIN_KEY)
+    passwd = config.get_user_option(PASSWD_KEY)
     if not server:
         bzrlib.trace.warning(
             'bzr_buildbot: ERROR.  If %s is set, %s must be set',
             HOOK_KEY, SERVER_KEY)
         return
+    if not login or not passwd:
+        bzrlib.trace.warning(
+            'bzr_buildbot: User and/or password not set, using defaults')
+        login = 'change'
+        passwd = 'changepw'
     change = generate_change(
         branch, old_revno, old_revid, new_revno, new_revid,
         blame_merge_author=_is_true(config, PQM_KEY))
@@ -403,7 +412,7 @@
     pbcf = twisted.spread.pb.PBClientFactory()
     reactor.connectTCP(server, port, pbcf)
     deferred = pbcf.login(
-        twisted.cred.credentials.UsernamePassword('change', 'changepw'))
+        twisted.cred.credentials.UsernamePassword(login, passwd))
 
     def sendChanges(remote):
         """Send changes to buildbot."""



More information about the lsb-messages mailing list