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

Unified Diff: client/example/payload/hello_world.py

Issue 1337633002: Reapply "Isolated task support in Endpoints API: client side (3/3)" and fixes" (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: Final fixes Created 5 years, 3 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 | « client/example/payload/hello_world.isolate ('k') | client/swarming.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/example/payload/hello_world.py
diff --git a/client/example/payload/hello_world.py b/client/example/payload/hello_world.py
index 86b15b382bed242860e4b13196f18a2784579314..d8a49d7ed00aaea2cf770a70710073f6a4fde791 100755
--- a/client/example/payload/hello_world.py
+++ b/client/example/payload/hello_world.py
@@ -3,13 +3,21 @@
# Use of this source code is governed under the Apache License, Version 2.0 that
# can be found in the LICENSE file.
-"""This script is meant to be run on a Swarm slave."""
+"""This script is meant to be run on a Swarming slave."""
+import os
import sys
def main():
print('Hello world: ' + sys.argv[1])
+ if len(sys.argv) == 3:
+ # Write a file in ${ISOLATED_OUTDIR}.
+ with open(os.path.join(sys.argv[2], 'happiness.txt'), 'wb') as f:
+ f.write(
+ 'is where you look %d/%d' % (
+ int(os.environ['GTEST_SHARD_INDEX']),
+ int(os.environ['GTEST_TOTAL_SHARDS'])))
return 0
« no previous file with comments | « client/example/payload/hello_world.isolate ('k') | client/swarming.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698