Jim MacArthur pushed to branch jmac/remote_exec_checkout_fix at BuildStream / buildstream
Commits:
-
bf8fd26a
by Jim MacArthur at 2018-09-19T13:10:57Z
1 changed file:
Changes:
... | ... | @@ -348,19 +348,29 @@ class CASCache(ArtifactCache): |
348 | 348 |
return pushed
|
349 | 349 |
|
350 | 350 |
def push_directory(self, project, directory):
|
351 |
+ """ Push the given virtual directory to all remotes.
|
|
352 |
+ |
|
353 |
+ Args:
|
|
354 |
+ project (Project): The current project
|
|
355 |
+ directory (Directory): A virtual directory object to push.
|
|
356 |
+ |
|
357 |
+ Raises: ArtifactError if no push remotes are configured.
|
|
358 |
+ """
|
|
351 | 359 |
|
352 | 360 |
push_remotes = [r for r in self._remotes[project] if r.spec.push]
|
353 | 361 |
|
362 |
+ if not push_remotes:
|
|
363 |
+ raise ArtifactError("CASCache: push_directory was called, but no remote artifact " +
|
|
364 |
+ "servers are configured as push remotes.")
|
|
365 |
+ |
|
354 | 366 |
if directory.ref is None:
|
355 |
- return None
|
|
367 |
+ return
|
|
356 | 368 |
|
357 | 369 |
for remote in push_remotes:
|
358 | 370 |
remote.init()
|
359 | 371 |
|
360 | 372 |
self._send_directory(remote, directory.ref)
|
361 | 373 |
|
362 |
- return directory.ref
|
|
363 |
- |
|
364 | 374 |
def push_message(self, project, message):
|
365 | 375 |
|
366 | 376 |
push_remotes = [r for r in self._remotes[project] if r.spec.push]
|