def _get_diff(self, cp_file):
diff = []<EOL>self._create_sot_file()<EOL>diff_out = self.device.show(<EOL>'<STR_LIT>'.format(<EOL>'<STR_LIT>', self.replace_file.split('<STR_LIT:/>')[-<NUM_LIT:1>]), raw_text=True)<EOL>try:<EOL><INDENT>diff_out = diff_out.split(<EOL>'<STR_LIT>')[<NUM_LIT:1>].replace(<EOL>'<STR_LIT>', '<STR_LIT>').strip()<EOL>for line in diff_out.splitlines():<EOL><INDENT>if line:<EOL><INDENT>if 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><DEDENT>return '<STR_LIT:\n>'.join(diff)<EOL>
Get a diff between running config and a proposed file.