# HG changeset patch # User osimons # Date 1259137012 0 # Node ID cc620fb0ee60550d8e3d7bc5ab65a0516d941e88 # Parent 75d53795bf8c8595e9b42f39c98bebcc212611de 0.6dev: Merging [792:793] from trunk. diff --git a/bitten/htdocs/bitten.css b/bitten/htdocs/bitten.css --- a/bitten/htdocs/bitten.css +++ b/bitten/htdocs/bitten.css @@ -163,15 +163,15 @@ /* collapsible failure details */ #content.build table.tests tr th p { margin: 0; padding: 0; text-align: left; } #content.build table.tests tr th p.details { - margin: 0; padding-left: 32px; padding-top: 5px; text-align: left; font-weight: normal; + margin: 0; padding-left: 4px; padding-top: 5px; text-align: left; font-weight: normal; } #content.build table.tests tr th p.details span { white-space: pre; font-family: monospace; font-weight: normal; font-size: smaller; color: #666; } -#content.build table.tests .fixture { display: inline; } +#content.build table.tests .fixture { display: inline-block; } #content.build table.tests tr.failed th .fixture a { - background: url(../common/expanded.png) 0 50% no-repeat; padding-left: 16px; + background: url(../common/expanded.png) 50% 50% no-repeat; padding-left: 16px; } #content.build table.tests tr.failed th.collapsed .fixture a { background-image: url(../common/collapsed.png); diff --git a/bitten/master.py b/bitten/master.py --- a/bitten/master.py +++ b/bitten/master.py @@ -99,8 +99,8 @@ if 'id' not in req.args: if req.method != 'POST': - self._send_error(req, HTTP_METHOD_NOT_ALLOWED, - 'Only POST allowed for build creation') + self._send_response(req, + body='Only POST allowed for build creation.') return self._process_build_creation(req, slave_token) build = Build.fetch(self.env, req.args['id']) diff --git a/bitten/slave.py b/bitten/slave.py --- a/bitten/slave.py +++ b/bitten/slave.py @@ -192,10 +192,12 @@ try: try: if self.username and not self.auth_map.get(url): + login_url = '%s/login?referer=%s' % (url[:-7], + urllib.quote_plus(url)) # First request to url, authentication needed if self.form_auth: log.debug('Performing http form authentication') - resp = self.request('POST', url[:-7] + '/login') + resp = self.request('POST', login_url) match = FORM_TOKEN_RE.search(resp.read()) if not match: log.error("Project %s does not support form " @@ -207,11 +209,11 @@ None, url)[1], 'referer': '', '__FORM_TOKEN': match.group(1)} - self.request('POST', url[:-7] + '/login', + self.request('POST', login_url, body=urllib.urlencode(values)) else: log.debug('Performing basic/digest authentication') - self.request('HEAD', url[:-7] + '/login') + self.request('HEAD', login_url) self.auth_map[url] = True elif self.username: log.debug('Reusing authentication information.') diff --git a/bitten/tests/master.py b/bitten/tests/master.py --- a/bitten/tests/master.py +++ b/bitten/tests/master.py @@ -144,8 +144,8 @@ self.assertRaises(RequestDone, module.process_request, req) - self.assertEquals(405, outheaders['Status']) - self.assertEquals('Only POST allowed for build creation', + self.assertEquals(200, outheaders['Status']) + self.assertEquals('Only POST allowed for build creation.', outbody.getvalue()) def test_create_build_no_match(self):