| OLD | NEW |
| 1 # Copyright 2013 The LUCI Authors. All rights reserved. | 1 # Copyright 2013 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed under the Apache License, Version 2.0 | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # that can be found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 """Main entry point for Swarming service. | 5 """Main entry point for Swarming service. |
| 6 | 6 |
| 7 This file contains the URL handlers for all the Swarming service URLs, | 7 This file contains the URL handlers for all the Swarming service URLs, |
| 8 implemented using the webapp2 framework. | 8 implemented using the webapp2 framework. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 scheduled. | 750 scheduled. |
| 751 """ | 751 """ |
| 752 | 752 |
| 753 @auth.require(acl.is_user) | 753 @auth.require(acl.is_user) |
| 754 def post(self, task_id): | 754 def post(self, task_id): |
| 755 original_request, secret_bytes, _ = self.get_request_and_result( | 755 original_request, secret_bytes, _ = self.get_request_and_result( |
| 756 task_id, with_secret_bytes=True) | 756 task_id, with_secret_bytes=True) |
| 757 # Retrying a task is essentially reusing the same task request as the | 757 # Retrying a task is essentially reusing the same task request as the |
| 758 # original one, but with new parameters. | 758 # original one, but with new parameters. |
| 759 new_request = task_request.new_request_clone( | 759 new_request = task_request.new_request_clone( |
| 760 original_request, secret_bytes, allow_high_priority=acl.is_admin()) | 760 original_request, secret_bytes, |
| 761 allow_high_priority=acl.can_schedule_high_priority_tasks()) |
| 761 result_summary = task_scheduler.schedule_request( | 762 result_summary = task_scheduler.schedule_request( |
| 762 new_request, secret_bytes) | 763 new_request, secret_bytes) |
| 763 self.redirect('/user/task/%s' % result_summary.task_id) | 764 self.redirect('/user/task/%s' % result_summary.task_id) |
| 764 | 765 |
| 765 | 766 |
| 766 ### Public pages. | 767 ### Public pages. |
| 767 | 768 |
| 768 | 769 |
| 769 class OldUIHandler(auth.AuthenticatingHandler): | 770 class OldUIHandler(auth.AuthenticatingHandler): |
| 770 @auth.public | 771 @auth.public |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 | 867 |
| 867 # If running on a local dev server, allow bots to connect without prior | 868 # If running on a local dev server, allow bots to connect without prior |
| 868 # groups configuration. Useful when running smoke test. | 869 # groups configuration. Useful when running smoke test. |
| 869 if utils.is_local_dev_server(): | 870 if utils.is_local_dev_server(): |
| 870 acl.bootstrap_dev_server_acls() | 871 acl.bootstrap_dev_server_acls() |
| 871 | 872 |
| 872 routes.extend(handlers_backend.get_routes()) | 873 routes.extend(handlers_backend.get_routes()) |
| 873 routes.extend(handlers_bot.get_routes()) | 874 routes.extend(handlers_bot.get_routes()) |
| 874 routes.extend(handlers_endpoints.get_routes()) | 875 routes.extend(handlers_endpoints.get_routes()) |
| 875 return webapp2.WSGIApplication(routes, debug=debug) | 876 return webapp2.WSGIApplication(routes, debug=debug) |
| OLD | NEW |