Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Unified Diff: appengine/swarming/handlers_endpoints.py

Issue 1942143002: swarming: isolate defaults (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@swarming-ns-re
Patch Set: rebased Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | appengine/swarming/handlers_endpoints_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/swarming/handlers_endpoints.py
diff --git a/appengine/swarming/handlers_endpoints.py b/appengine/swarming/handlers_endpoints.py
index f130e3109fd392e0881bdc5fbd9a2b08670ea99c..cab79d25ab09906b1084d8342de0df4c8636a6aa 100644
--- a/appengine/swarming/handlers_endpoints.py
+++ b/appengine/swarming/handlers_endpoints.py
@@ -267,6 +267,22 @@ class SwarmingTasksService(remote.Service):
in the task request.
"""
logging.info('%s', request)
+
+ if not request.properties:
+ raise endpoints.BadRequestException('properties are required')
+
+ # Apply isolate defaults.
+ cfg = config.settings()
+ if cfg.isolate.default_server and cfg.isolate.default_namespace:
+ request.properties.inputs_ref = (
+ request.properties.inputs_ref or swarming_rpcs.FilesRef())
+ request.properties.inputs_ref.isolatedserver = (
+ request.properties.inputs_ref.isolatedserver or
+ cfg.isolate.default_server)
+ request.properties.inputs_ref.namespace = (
+ request.properties.inputs_ref.namespace or
+ cfg.isolate.default_namespace)
+
try:
request = message_conversion.new_task_request_from_rpc(
request, utils.utcnow())
« no previous file with comments | « no previous file | appengine/swarming/handlers_endpoints_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698