Fix problem with read rights on remote build machine

This commit is contained in:
Anders Ingemann 2014-12-14 15:38:44 +01:00
parent 288c5f4c57
commit a8e5c2d6e4

View file

@ -131,16 +131,20 @@ class RemoteBuildServer(BuildServer):
self.ssh_process.wait()
def download(self, src, dst):
# Make sure we can read the file as {user}
self._remote_command(['sudo', 'chown', self.username, src])
src_arg = '{user}@{host}:{path}'.format(user=self.username, host=self.address, path=src)
log_check_call(['scp', '-i', self.keyfile, '-P', str(self.port),
src_arg, dst])
def delete(self, path):
self._remote_command(['sudo', 'rm', path])
def _remote_command(self, command):
ssh_cmd = ['ssh', '-i', self.keyfile,
'-p', str(self.port),
self.username + '@' + self.address,
'--',
'sudo', 'rm', path]
'--'] + command
log_check_call(ssh_cmd)