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

Side by Side Diff: client/cipd.py

Issue 2066913002: swarming-cipd: fix for Windows (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@master
Patch Set: file_path.remove 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 unified diff | Download patch
« no previous file with comments | « no previous file | client/utils/file_path.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The LUCI Authors. All rights reserved. 1 # Copyright 2016 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed under the Apache License, Version 2.0 2 # Use of this source code is governed under the Apache License, Version 2.0
3 # that can be found in the LICENSE file. 3 # that can be found in the LICENSE file.
4 4
5 """Fetches CIPD client and installs packages.""" 5 """Fetches CIPD client and installs packages."""
6 6
7 __version__ = '0.1' 7 __version__ = '0.1'
8 8
9 import contextlib 9 import contextlib
10 import hashlib 10 import hashlib
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 logging.info('Fetching CIPD client %s:%s', package_name, instance_id) 388 logging.info('Fetching CIPD client %s:%s', package_name, instance_id)
389 fetch_url = get_client_fetch_url( 389 fetch_url = get_client_fetch_url(
390 service_url, package_name, instance_id, timeout=timeoutfn()) 390 service_url, package_name, instance_id, timeout=timeoutfn())
391 _fetch_cipd_client(instance_cache, instance_id, fetch_url, timeoutfn) 391 _fetch_cipd_client(instance_cache, instance_id, fetch_url, timeoutfn)
392 392
393 # A single host can run multiple swarming bots, but ATM they do not share 393 # A single host can run multiple swarming bots, but ATM they do not share
394 # same root bot directory. Thus, it is safe to use the same name for the 394 # same root bot directory. Thus, it is safe to use the same name for the
395 # binary. 395 # binary.
396 binary_path = unicode(os.path.join(cache_dir, 'cipd' + EXECUTABLE_SUFFIX)) 396 binary_path = unicode(os.path.join(cache_dir, 'cipd' + EXECUTABLE_SUFFIX))
397 if fs.isfile(binary_path): 397 if fs.isfile(binary_path):
398 fs.unlink(binary_path) 398 file_path.remove(binary_path)
399 instance_cache.hardlink(instance_id, binary_path, 0511) # -r-x--x--x 399 instance_cache.hardlink(instance_id, binary_path, 0511) # -r-x--x--x
400 400
401 yield CipdClient(binary_path) 401 yield CipdClient(binary_path)
OLDNEW
« no previous file with comments | « no previous file | client/utils/file_path.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698