'Write the given lines (as a list of strings) to a file.  If
paired_with_process is given, the file will be written on the drone
running the given Process.  Otherwise, the file will be written to the
results repository.'

def write_lines_to_file(self, file_path, lines, paired_with_process=None):

    file_contents = ('\n'.join(lines) + '\n')
    if paired_with_process:
        drone = self._get_drone_for_process(paired_with_process)
        on_results_repository = False
    else:
        drone = self._results_drone
        on_results_repository = True
    full_path = self.absolute_path(file_path, on_results_repository=on_results_repository)
    drone.queue_call('write_to_file', full_path, file_contents)
