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

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: swarming: isolate defaults and output Created 4 years, 8 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') | appengine/swarming/proto/config.proto » ('J')
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..0f265247d605b2ecd04b4fff0379d8c35773d083 100644
--- a/appengine/swarming/handlers_endpoints.py
+++ b/appengine/swarming/handlers_endpoints.py
@@ -267,6 +267,23 @@ class SwarmingTasksService(remote.Service):
in the task request.
"""
logging.info('%s', request)
+
+ # Apply isolate defaults.
+ cfg = config.settings()
+ if cfg.isolate.default_server_host and cfg.isolate.default_namespace:
+ request.properties = request.properties or swarming_rpcs.TaskProperties()
M-A Ruel 2016/05/10 15:27:40 request.properties cannot be None so this is not n
nodir 2016/05/10 18:49:49 Done.
+ default_server = 'https://' + cfg.isolate.default_server_host
M-A Ruel 2016/05/10 15:27:40 Do not prepend https:// here, it should be listed
nodir 2016/05/10 18:49:49 Done.
+ inputs_ref = request.properties.inputs_ref
+ if inputs_ref:
+ inputs_ref.isolatedserver = inputs_ref.isolatedserver or default_server
+ inputs_ref.namespace = (
+ inputs_ref.namespace or cfg.isolate.default_namespace)
+ elif not request.properties.outputs_target:
M-A Ruel 2016/05/10 15:27:40 Please remove.
nodir 2016/05/10 18:49:49 Done in patchset 'rebased'
+ request.properties.outputs_target = (
+ swarming_rpcs.IsolatedOutputsTarget(
+ isolatedserver=default_server,
+ namespace=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') | appengine/swarming/proto/config.proto » ('J')

Powered by Google App Engine
This is Rietveld 408576698