| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 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 | 5 |
| 6 """Script that attempts to push to a special git repository to verify that git | 6 """Script that attempts to push to a special git repository to verify that git |
| 7 credentials are configured correctly. It also verifies that gclient solution is | 7 credentials are configured correctly. It also verifies that gclient solution is |
| 8 configured to use git checkout. | 8 configured to use git checkout. |
| 9 | 9 |
| 10 It will be added as gclient hook shortly before Chromium switches to git and | 10 It will be added as gclient hook shortly before Chromium switches to git and |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 'deps_file': '.DEPS.git', | 63 'deps_file': '.DEPS.git', |
| 64 'managed': False, | 64 'managed': False, |
| 65 'url': 'https://chromium.googlesource.com/chromium/src.git', | 65 'url': 'https://chromium.googlesource.com/chromium/src.git', |
| 66 } | 66 } |
| 67 | 67 |
| 68 # Possible chunks of git push response in case .netrc is misconfigured. | 68 # Possible chunks of git push response in case .netrc is misconfigured. |
| 69 BAD_ACL_ERRORS = ( | 69 BAD_ACL_ERRORS = ( |
| 70 '(prohibited by Gerrit)', | 70 '(prohibited by Gerrit)', |
| 71 'does not match your user account', | 71 'does not match your user account', |
| 72 'Invalid user name or password', | 72 'Invalid user name or password', |
| 73 'Please make sure you have the correct access rights', |
| 73 ) | 74 ) |
| 74 | 75 |
| 75 | 76 |
| 76 def is_on_bot(): | 77 def is_on_bot(): |
| 77 """True when running under buildbot.""" | 78 """True when running under buildbot.""" |
| 78 return os.environ.get('CHROME_HEADLESS') == '1' | 79 return os.environ.get('CHROME_HEADLESS') == '1' |
| 79 | 80 |
| 80 | 81 |
| 81 def is_in_google_corp(): | 82 def is_in_google_corp(): |
| 82 """True when running in google corp network.""" | 83 """True when running in google corp network.""" |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 write_last_configuration(config) | 479 write_last_configuration(config) |
| 479 else: | 480 else: |
| 480 logging.warning('Check failed and will be retried on the next run') | 481 logging.warning('Check failed and will be retried on the next run') |
| 481 except Exception: | 482 except Exception: |
| 482 logging.exception('Unexpected exception when performing git access check') | 483 logging.exception('Unexpected exception when performing git access check') |
| 483 return 0 | 484 return 0 |
| 484 | 485 |
| 485 | 486 |
| 486 if __name__ == '__main__': | 487 if __name__ == '__main__': |
| 487 sys.exit(main(sys.argv[1:])) | 488 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |