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

Side by Side Diff: infra/bots/assets/asset_utils.py

Issue 2321623003: Asset management: Download from GS store instead of CIPD (Closed)
Patch Set: Created 4 years, 3 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2016 Google Inc. 3 # Copyright 2016 Google Inc.
4 # 4 #
5 # Use of this source code is governed by a BSD-style license that can be 5 # Use of this source code is governed by a BSD-style license that can be
6 # found in the LICENSE file. 6 # found in the LICENSE file.
7 7
8 8
9 """Utilities for managing assets.""" 9 """Utilities for managing assets."""
10 10
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 self._gs = GSStore(gsutil=gsutil, bucket=gs_bucket) 213 self._gs = GSStore(gsutil=gsutil, bucket=gs_bucket)
214 214
215 def get_available_versions(self, name): 215 def get_available_versions(self, name):
216 return self._cipd.get_available_versions(name) 216 return self._cipd.get_available_versions(name)
217 217
218 def upload(self, name, version, target_dir): 218 def upload(self, name, version, target_dir):
219 self._cipd.upload(name, version, target_dir) 219 self._cipd.upload(name, version, target_dir)
220 self._gs.upload(name, version, target_dir) 220 self._gs.upload(name, version, target_dir)
221 221
222 def download(self, name, version, target_dir): 222 def download(self, name, version, target_dir):
223 self._cipd.download(name, version, target_dir) 223 self._gs.download(name, version, target_dir)
224 224
225 def delete_contents(self, name): 225 def delete_contents(self, name):
226 self._cipd.delete_contents(name) 226 self._cipd.delete_contents(name)
227 self._gs.delete_contents(name) 227 self._gs.delete_contents(name)
228 228
229 229
230 def _prompt(prompt): 230 def _prompt(prompt):
231 """Prompt for input, return result.""" 231 """Prompt for input, return result."""
232 return raw_input(prompt) 232 return raw_input(prompt)
233 233
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 raise Exception('Asset %s does not exist!' % self._name) 323 raise Exception('Asset %s does not exist!' % self._name)
324 324
325 # Cleanup the store. 325 # Cleanup the store.
326 if remove_in_store: 326 if remove_in_store:
327 self._store.delete_contents(self._name) 327 self._store.delete_contents(self._name)
328 328
329 # Remove the asset. 329 # Remove the asset.
330 subprocess.check_call([utils.GIT, 'rm', '-rf', self._dir]) 330 subprocess.check_call([utils.GIT, 'rm', '-rf', self._dir])
331 if os.path.isdir(self._dir): 331 if os.path.isdir(self._dir):
332 shutil.rmtree(self._dir) 332 shutil.rmtree(self._dir)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698