diff options
Diffstat (limited to 'infra')
-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) |