diff options
author | borenet <borenet@chromium.org> | 2016-09-09 05:37:29 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-09 05:37:29 -0700 |
commit | a42405aa522cd33292b9817da460e9f29e00a201 (patch) | |
tree | 4bf56b892d820a1ea0785adf39fe4552c308bfd3 /infra/bots | |
parent | e06ca96174b99d451db17540a8df540035ab020d (diff) |
Fix issues in assets scripts
- Delete unconditionally uses 'gsutil'
- args.gsutil not plumbed properly
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2326663002
Review-Url: https://codereview.chromium.org/2326663002
Diffstat (limited to 'infra/bots')
-rw-r--r-- | infra/bots/assets/asset_utils.py | 4 | ||||
-rwxr-xr-x | infra/bots/assets/assets.py | 12 |
2 files changed, 10 insertions, 6 deletions
diff --git a/infra/bots/assets/asset_utils.py b/infra/bots/assets/asset_utils.py index 8a1404fc56..ae58d4539f 100644 --- a/infra/bots/assets/asset_utils.py +++ b/infra/bots/assets/asset_utils.py @@ -198,11 +198,11 @@ class GSStore(object): gs_path = GS_SUBDIR_TMPL % (self._gs_bucket, name) attempt_delete = True try: - subprocess.check_call(['gsutil', 'ls', gs_path]) + subprocess.check_call(self._gsutil + ['ls', gs_path]) except subprocess.CalledProcessError: attempt_delete = False if attempt_delete: - subprocess.check_call(['gsutil', 'rm', '-rf', gs_path]) + subprocess.check_call(self._gsutil + ['rm', '-rf', gs_path]) class MultiStore(object): diff --git a/infra/bots/assets/assets.py b/infra/bots/assets/assets.py index b398988338..3265a63b9e 100755 --- a/infra/bots/assets/assets.py +++ b/infra/bots/assets/assets.py @@ -25,23 +25,27 @@ import utils def add(args): """Add a new asset.""" - asset_utils.Asset.add(args.asset_name, asset_utils.MultiStore()) + asset_utils.Asset.add(args.asset_name, + asset_utils.MultiStore(gsutil=args.gsutil)) def remove(args): """Remove an asset.""" - asset_utils.Asset(args.asset_name, asset_utils.MultiStore()).remove() + asset_utils.Asset(args.asset_name, + asset_utils.MultiStore(gsutil=args.gsutil)).remove() def download(args): """Download the current version of an asset.""" - asset = asset_utils.Asset(args.asset_name, asset_utils.MultiStore()) + asset = asset_utils.Asset(args.asset_name, + asset_utils.MultiStore(gsutil=args.gsutil)) asset.download_current_version(args.target_dir) def upload(args): """Upload a new version of the asset.""" - asset = asset_utils.Asset(args.asset_name, asset_utils.MultiStore()) + asset = asset_utils.Asset(args.asset_name, + asset_utils.MultiStore(gsutil=args.gsutil)) asset.upload_new_version(args.target_dir, commit=args.commit) |