From 374d1d7e890b1d2dd1367ed393eef2cdb9d2aad3 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Tue, 26 May 2015 13:40:21 -0400 Subject: [PATCH] Fix case where the auth token was not written properly for BitBucket --- endpoints/trigger.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/endpoints/trigger.py b/endpoints/trigger.py index 2bcdc6242..311c6aaf5 100644 --- a/endpoints/trigger.py +++ b/endpoints/trigger.py @@ -244,7 +244,11 @@ class BitbucketBuildTrigger(BuildTriggerHandler): def _get_authorized_client(self): base_client = self._get_client() auth_token = self.auth_token or 'invalid:invalid' - (access_token, access_token_secret) = auth_token.split(':') + token_parts = auth_token.split(':') + if len(token_parts) != 2: + token_parts = ['invalid', 'invalid'] + + (access_token, access_token_secret) = token_parts return base_client.get_authorized_client(access_token, access_token_secret) def _get_repository_client(self):