def _get_diff(self):
diff = []<EOL>self._create_sot_file()<EOL>diff_out = self._send_command(<EOL>"<STR_LIT>".format(<EOL>"<STR_LIT>", self.candidate_cfg<EOL>),<EOL>raw_text=True,<EOL>)<EOL>try:<EOL><INDENT>diff_out = (<EOL>diff_out.split("<STR_LIT>")[<NUM_LIT:1>]<EOL>.replace("<STR_LIT>", "<STR_LIT>")<EOL>.strip()<EOL>)<EOL>for line in diff_out.splitlines():<EOL><INDENT>if line:<EOL><INDENT>if line[<NUM_LIT:0>].strip() != "<STR_LIT:!>" and line[<NUM_LIT:0>].strip() != "<STR_LIT:.>":<EOL><INDENT>diff.append(line.rstrip("<STR_LIT:U+0020>"))<EOL><DEDENT><DEDENT><DEDENT><DEDENT>except (AttributeError, KeyError):<EOL><INDENT>raise ReplaceConfigException(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>return "<STR_LIT:\n>".join(diff)<EOL>
Get a diff between running config and a proposed file.