diff options
author | Jürg Billeter <j@bitron.ch> | 2017-05-30 11:07:21 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2017-06-27 10:30:29 +0200 |
commit | 8c857b63011743948e962fca0eb301cf183b71c9 (patch) | |
tree | 545fcac9a1e040a4df504b7acdbc9b9957e090be /buildstream/_ostree.py | |
parent | e33ed2ff1450efc0b8e459d58d5d1a768884423e (diff) | |
download | buildstream-8c857b63011743948e962fca0eb301cf183b71c9.tar.gz |
_ostree.py: Add SSH artifact fetch support
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 |