Skip to content

Commit

Permalink
Add support for username/passwd in TextClient
Browse files Browse the repository at this point in the history
  • Loading branch information
krajaratnam committed Feb 11, 2010
1 parent 41ac805 commit 6fbe636
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions buildbot/clients/base.py
Expand Up @@ -61,10 +61,17 @@ def remote_logChunk(self, buildername, build, stepname, step, logname, log,
print "logChunk[%s]: %s" % (ChunkTypes[channel], text)

class TextClient:
def __init__(self, master, events="steps"):
def __init__(self, master, events="steps", username="statusClient", passwd="clientpw"):
"""
@type master: string
@param master: a host:port string to masters L{buildbot.status.client.PBListener}
@type username: string
@param username:
@type passwd: string
@param passwd:
@type events: string, one of builders, builds, steps, logs, full
@param events: specify what level of detail should be reported.
- 'builders': only announce new/removed Builders
Expand All @@ -75,6 +82,8 @@ def __init__(self, master, events="steps"):
- 'full': also announce log contents
"""
self.master = master
self.username = username
self.passwd = passwd
self.listener = StatusClient(events)

def run(self):
Expand All @@ -91,7 +100,7 @@ def startConnecting(self):
print " expecting something more like localhost:8007"
raise
cf = pb.PBClientFactory()
creds = credentials.UsernamePassword("statusClient", "clientpw")
creds = credentials.UsernamePassword(self.username, self.passwd)
d = cf.login(creds)
reactor.connectTCP(host, port, cf)
d.addCallbacks(self.connected, self.not_connected)
Expand Down

0 comments on commit 6fbe636

Please sign in to comment.