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

Unified Diff: client/cipd.py

Issue 2060983006: luci-py/isolateserver.py: Add archive support when downloading. (Closed) Base URL: https://github.com/luci/luci-py.git@master
Patch Set: Adding a test. Created 4 years, 6 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
Index: client/cipd.py
diff --git a/client/cipd.py b/client/cipd.py
index 6065dbf81f13c2f3d8fb70ea4578bfea71c7c528..a550312b9b4a629dd9c902e534c30d2f6e47309f 100644
--- a/client/cipd.py
+++ b/client/cipd.py
@@ -356,7 +356,7 @@ def get_client(
# cache by hashing it.
version_digest = hashlib.sha1(version).hexdigest()
try:
- instance_id = version_cache.read(version_digest)
+ instance_id = version_cache.getfileobj(version_digest).read()
nodir 2016/06/20 15:54:34 DiskCache.getfileobject returns a file and it is r
mithro 2016/06/21 06:42:33 I've changed this one to a "with xxxx". See my co
except isolateserver.CacheMiss:
instance_id = resolve_version(
service_url, package_name, version, timeout=timeoutfn())
@@ -381,8 +381,10 @@ def get_client(
binary_path = unicode(os.path.join(cache_dir, 'cipd' + EXECUTABLE_SUFFIX))
if fs.isfile(binary_path):
file_path.remove(binary_path)
- instance_cache.hardlink(instance_id, binary_path, 0511) # -r-x--x--x
-
+ isolateserver.putfile(
+ instance_cache.getfileobj(instance_id),
+ binary_path,
+ 0511) # -r-x--x--x
yield CipdClient(binary_path)

Powered by Google App Engine
This is Rietveld 408576698