1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-07-04 16:30:12 +02:00

buildserver: run_via_vagrant_ssh() to run cmds via python-vagrant

This moves the last vagrant call in a subprocess.
This commit is contained in:
Hans-Christoph Steiner 2016-06-23 16:38:39 +02:00
parent 6464ec55b7
commit 4cde71552f

View File

@ -293,6 +293,14 @@ def sha256_for_file(path):
return s.hexdigest()
def run_via_vagrant_ssh(v, cmdlist):
if (isinstance(cmdlist, str) or isinstance(cmdlist, bytes)):
cmd = cmdlist
else:
cmd = ' '.join(cmdlist)
v._run_vagrant_command(['ssh', '-c', cmd])
def main():
global cachedir, cachefiles, config, tail
@ -434,10 +442,7 @@ def main():
universal_newlines=True)
buildserverid = p.communicate()[0].strip()
print("...ID is " + buildserverid)
subprocess.call(
['vagrant', 'ssh', '-c', 'sh -c "echo {0} >/home/vagrant/buildserverid"'
.format(buildserverid)],
cwd=serverdir)
run_via_vagrant_ssh(v, 'sh -c "echo %s >/home/vagrant/buildserverid"' % buildserverid)
print("Stopping build server VM")
v.halt()