def diff_config(self, source: str='running') -> ScrapliCfgDiffResponse:
    scrapli_responses = []
    device_diff = ''
    source_config = ''
    diff_response = self._pre_diff_config(source=source, session_or_config_file=bool(self.candidate_config_filename))
    try:
        diff_result = self.conn.send_command(command=self._get_diff_command(source=source))
        scrapli_responses.append(diff_result)
        if diff_result.failed:
            msg = 'failed generating diff for config session'
            self.logger.critical(msg)
            raise DiffConfigError(msg)
        device_diff = diff_result.result
        source_config_result = self.get_config(source=source)
        source_config = source_config_result.result
        if isinstance(source_config_result.scrapli_responses, MultiResponse):
            scrapli_responses.extend(source_config_result.scrapli_responses)
        if source_config_result.failed:
            msg = 'failed fetching source config for diff comparison'
            self.logger.critical(msg)
            raise DiffConfigError(msg)
    except DiffConfigError:
        pass
    (source_config, candidate_config) = self._normalize_source_candidate_configs(source_config=source_config)
    return self._post_diff_config(diff_response=diff_response, scrapli_responses=scrapli_responses, source_config=source_config, candidate_config=candidate_config, device_diff=device_diff)
def diff_config(self, source: str='running') -> ScrapliCfgDiffResponse:
    scrapli_responses = []
    device_diff = 
    source_config = 
    diff_response = self._pre_diff_config(source=source, session_or_config_file=bool(self.candidate_config_filename))
    try:
        diff_result = self.conn.send_command(command=self._get_diff_command(source=source))
        scrapli_responses.append(diff_result)
        if diff_result.failed:
            msg = 'failed generating diff for config session'
            self.logger.critical(msg)
            raise DiffConfigError(msg)
        device_diff = diff_result.result
        source_config_result = self.get_config(source=source)
        source_config = source_config_result.result
        if isinstance(source_config_result.scrapli_responses, MultiResponse):
            scrapli_responses.extend(source_config_result.scrapli_responses)
        if source_config_result.failed:
            msg = 'failed fetching source config for diff comparison'
            self.logger.critical(msg)
            raise DiffConfigError(msg)
    except DiffConfigError:
        pass
    (source_config, candidate_config) = self._normalize_source_candidate_configs(source_config=source_config)
    return self._post_diff_config(diff_response=diff_response, scrapli_responses=scrapli_responses, source_config=source_config, candidate_config=candidate_config, device_diff=device_diff)