def execute_ (self, arguments) : self.enforce_length (arguments, 1) machine = self.enforce_select_machine (arguments[0]) exit_code = self.execute_ssh (ProcessModes.NullWithStdoutToStderrText, machine.host, machine.user, 'test', '!', '-d', machine.store) if not exit_code == 0 : return Outcomes.Failure ('store already exists; aborting.') exit_code = self.execute_ssh (ProcessModes.NullWithStdoutToStderrText, machine.host, machine.user, 'mkdir', '-p', machine.store) if not exit_code == 0 : return Outcomes.Failure ('store can not be created; aborting.') tar_process = self.start_local (ProcessModes.PipedBinary, 'tar', '-c', './sources') tar_process.output_stream.close () untar_process = self.start_ssh (ProcessModes.PipedBinary, machine.host, machine.user, 'tar', '-x', '-C', machine.store) untar_process.input_stream.close () while True : buffer = tar_process.input_stream.read (1024) if buffer == '' : break untar_process.output_stream.write (buffer) untar_process.output_stream.flush () tar_process.join () untar_process.join () frontend = Frontend (machine.host, machine.user, machine.store) return frontend.execute ('deploy-machine', [])