| OLD | NEW |
| 1 # coding: utf-8 | 1 # coding: utf-8 |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 """Defines class Rietveld to easily access a rietveld instance. | 5 """Defines class Rietveld to easily access a rietveld instance. |
| 6 | 6 |
| 7 Security implications: | 7 Security implications: |
| 8 | 8 |
| 9 The following hypothesis are made: | 9 The following hypothesis are made: |
| 10 - Rietveld enforces: | 10 - Rietveld enforces: |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 client_private_key_file, | 572 client_private_key_file, |
| 573 private_key_password=None, | 573 private_key_password=None, |
| 574 extra_headers=None, | 574 extra_headers=None, |
| 575 maxtries=None): | 575 maxtries=None): |
| 576 | 576 |
| 577 if private_key_password is None: # '' means 'empty password' | 577 if private_key_password is None: # '' means 'empty password' |
| 578 private_key_password = 'notasecret' | 578 private_key_password = 'notasecret' |
| 579 | 579 |
| 580 self.url = url.rstrip('/') | 580 self.url = url.rstrip('/') |
| 581 bot_url = self.url | 581 bot_url = self.url |
| 582 # TODO(tandrii): remove temp fix due to cert problem: crbug/537763 |
| 583 if bot_url.endswith('codereview.chromium.org'): |
| 584 bot_url = 'https://chromiumcodereview.appspot.com' |
| 582 if self.url.endswith('googleplex.com'): | 585 if self.url.endswith('googleplex.com'): |
| 583 bot_url = self.url + '/bots' | 586 bot_url = self.url + '/bots' |
| 584 | 587 |
| 585 with open(client_private_key_file, 'rb') as f: | 588 with open(client_private_key_file, 'rb') as f: |
| 586 client_private_key = f.read() | 589 client_private_key = f.read() |
| 587 logging.info('Using OAuth login: %s' % client_email) | 590 logging.info('Using OAuth login: %s' % client_email) |
| 588 self.rpc_server = OAuthRpcServer(bot_url, | 591 self.rpc_server = OAuthRpcServer(bot_url, |
| 589 client_email, | 592 client_email, |
| 590 client_private_key, | 593 client_private_key, |
| 591 private_key_password=private_key_password, | 594 private_key_password=private_key_password, |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 self, issue, patchset, reason, clobber, revision, builders_and_tests, | 720 self, issue, patchset, reason, clobber, revision, builders_and_tests, |
| 718 master=None, category='cq'): | 721 master=None, category='cq'): |
| 719 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % | 722 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % |
| 720 (builders_and_tests, issue)) | 723 (builders_and_tests, issue)) |
| 721 | 724 |
| 722 def trigger_distributed_try_jobs( # pylint:disable=R0201 | 725 def trigger_distributed_try_jobs( # pylint:disable=R0201 |
| 723 self, issue, patchset, reason, clobber, revision, masters, | 726 self, issue, patchset, reason, clobber, revision, masters, |
| 724 category='cq'): | 727 category='cq'): |
| 725 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % | 728 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % |
| 726 (masters, issue)) | 729 (masters, issue)) |
| OLD | NEW |