def commit(self, *args, **kwargs): """Activate changes from private candidate for Nokia SR OS""" output = self._exit_all() if "@" in self.base_prompt and "*(ex)[" in output: log.info("Apply uncommitted changes!") cmd = "commit" self.write_channel(self.normalize_cmd(cmd)) output += self.read_until_pattern(pattern=re.escape(cmd)) output += self.read_until_pattern(r"@") return output
def commit(self, *args: Any, **kwargs: Any) -> str: """Activate changes from private candidate for Nokia SR OS""" output = self._exit_all() if "@" in self.base_prompt and "*(ex)[" in output: log.info("Apply uncommitted changes!") cmd = "commit" self.write_channel(self.normalize_cmd(cmd)) new_output = "" if self.global_cmd_verify is not False: new_output += self.read_until_pattern(pattern=re.escape(cmd)) if "@" not in new_output: new_output += self.read_until_pattern(r"@") output += new_output return output