@_file_prompt_quiet<EOL><INDENT>def _commit_handler(self, cmd):<DEDENT>
current_prompt = self.device.find_prompt().strip()<EOL>terminating_char = current_prompt[-<NUM_LIT:1>]<EOL>pattern1 = r"<STR_LIT>".format(terminating_char)<EOL>pattern2 = r"<STR_LIT>"<EOL>patterns = r"<STR_LIT>".format(pattern1, pattern2)<EOL>output = self.device.send_command_expect(cmd, expect_string=patterns)<EOL>loop_count = <NUM_LIT:50><EOL>new_output = output<EOL>for i in range(loop_count):<EOL><INDENT>if re.search(pattern2, new_output):<EOL><INDENT>new_output = self.device.send_command_timing(<EOL>"<STR_LIT:\n>", strip_prompt=False, strip_command=False<EOL>)<EOL>output += new_output<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>self.device.set_base_prompt()<EOL>return output<EOL>
Special handler for hostname change on commit operation. Also handles username removal
which prompts for confirmation (username removal prompts for each user...)