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

Unified Diff: swarm_trigger_step.py

Issue 23431002: [Abandoned] Move url_open with dependencies to utils.net module. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/swarm_client
Patch Set: Created 7 years, 4 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 | « swarm_get_results.py ('k') | tests/isolateserver_archive_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: swarm_trigger_step.py
diff --git a/swarm_trigger_step.py b/swarm_trigger_step.py
index 75dd846543869cf1de68af1c5c74b782516fa7a6..f72046d9e1884a1a12cf49e781b0d056366d988d 100755
--- a/swarm_trigger_step.py
+++ b/swarm_trigger_step.py
@@ -19,8 +19,7 @@ import sys
import time
import urllib
-import run_isolated
-
+from utils import net
from utils import tools
from utils import zip_package
@@ -83,7 +82,7 @@ class Manifest(object):
def _token(self):
if not self._token_cache:
- result = run_isolated.url_open(self._data_server_get_token)
+ result = net.url_open(self._data_server_get_token)
if not result:
# TODO(maruel): Implement authentication.
raise Failure('Failed to get token, need authentication')
@@ -114,7 +113,7 @@ class Manifest(object):
self._zip_file_hash = hashlib.sha1(zip_contents).hexdigest()
print 'Zipping completed, time elapsed: %f' % (time.time() - start_time)
- response = run_isolated.url_open(
+ response = net.url_open(
self._data_server_has + '?token=%s' % self._token(),
data=binascii.unhexlify(self._zip_file_hash),
content_type='application/octet-stream')
@@ -131,7 +130,7 @@ class Manifest(object):
url = '%s%s?priority=0&token=%s' % (
self._data_server_storage, self._zip_file_hash, self._token())
- response = run_isolated.url_open(
+ response = net.url_open(
url, data=zip_contents, content_type='application/octet-stream')
if response is None:
print >> sys.stderr, 'Failed to upload the zip file: %s' % url
@@ -182,6 +181,8 @@ def chromium_setup(manifest):
Highly chromium specific.
"""
+ import run_isolated
+
# Add uncompressed zip here. It'll be compressed as part of the package sent
# to Swarming server.
run_test_name = 'run_isolated.zip'
@@ -231,7 +232,7 @@ def process_manifest(
print('Job name: %s' % test_name)
test_url = swarm_url.rstrip('/') + '/test'
manifest_text = manifest.to_json()
- result = run_isolated.url_open(test_url, data={'request': manifest_text})
+ result = net.url_open(test_url, data={'request': manifest_text})
if not result:
print >> sys.stderr, 'Failed to send test for %s\n%s' % (
test_name, test_url)
« no previous file with comments | « swarm_get_results.py ('k') | tests/isolateserver_archive_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698