diff options
Diffstat (limited to 'buildstream/_ostree.py')
-rw-r--r-- | buildstream/_ostree.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/buildstream/_ostree.py b/buildstream/_ostree.py index fdb37eb91..edf646e4f 100644 --- a/buildstream/_ostree.py +++ b/buildstream/_ostree.py @@ -270,6 +270,28 @@ def fetch(repo, remote="origin", ref=None, progress=None): raise OSTreeError("Failed to fetch from '{}': {}".format(remote, e.message)) from e +# fetch_ssh() +# +# Pushes a ref to a remote repository +# +# Args: +# repo (OSTree.Repo): The repo +# remote (str): The url of the remote ostree repo +# ref (str): A ref to push +# +def fetch_ssh(repo, remote, ref): + exit_code, output = utils._call([ + _site.ostree_pull_ssh, + '--repo=' + repo.get_path().get_path(), + remote, + ref], + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + + if exit_code: + raise OSTreeError("Failed to fetch artifact from remote SSH repository:\n{}".format(output)) + + # push() # # Pushes a ref to a remote repository |