Chromium Code Reviews| Index: client/cipd.py |
| diff --git a/client/cipd.py b/client/cipd.py |
| index 6065dbf81f13c2f3d8fb70ea4578bfea71c7c528..1f7d6b96fefa75bb2f33814cc7aa6d39447a90bc 100644 |
| --- a/client/cipd.py |
| +++ b/client/cipd.py |
| @@ -356,7 +356,8 @@ def get_client( |
| # cache by hashing it. |
| version_digest = hashlib.sha1(version).hexdigest() |
| try: |
| - instance_id = version_cache.read(version_digest) |
| + with version_cache.getfileobj(version_digest) as f: |
| + instance_id = f.read() |
| except isolateserver.CacheMiss: |
| instance_id = resolve_version( |
| service_url, package_name, version, timeout=timeoutfn()) |
| @@ -381,8 +382,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), |
|
nodir
2016/06/21 22:20:05
here too
mithro
2016/06/22 12:03:10
Done.
|
| + binary_path, |
| + 0511) # -r-x--x--x |
| yield CipdClient(binary_path) |