def runner(self): if self.__runner__ is None: # device = self.device spawned_shell = self.raw_connection # ShellCommand(pexpect.spawn) # FIXME: the prompts should not be needed here, only kvm uses these. Remove. # prompt_str = parameters['prompts'] prompt_str_includes_rc = True # FIXME - parameters['deployment_data']['TESTER_PS1_INCLUDES_RC']? # prompt_str_includes_rc = device.config.tester_ps1_includes_rc # The Connection for a CommandRunner in the pipeline needs to be a ShellCommand, not logging_spawn self.__runner__ = CommandRunner(spawned_shell, self.prompt_str, prompt_str_includes_rc) return self.__runner__
def test_connection(self): """ Yields the actual connection which can be used to interact inside this shell. """ if self.__runner__ is None: spawned_shell = self.raw_connection # ShellCommand(pexpect.spawn) # prompt_str = parameters['prompts'] prompt_str_includes_rc = True # FIXME - do we need this? # prompt_str_includes_rc = device.config.tester_ps1_includes_rc # The Connection for a CommandRunner in the pipeline needs to be a ShellCommand, not logging_spawn self.__runner__ = CommandRunner(spawned_shell, self.prompt_str, prompt_str_includes_rc) yield self.__runner__.get_connection()