diff --git a/bootstrapvz/remote/build_servers.py b/bootstrapvz/remote/build_servers.py index 013c769..cdcbdf0 100644 --- a/bootstrapvz/remote/build_servers.py +++ b/bootstrapvz/remote/build_servers.py @@ -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)