'Exit from configuration mode.'

def exit_config_mode(self, exit_config=u'exit', pattern=u'#'):

    output = u''
    if self.check_config_mode():
        self.write_channel(self.normalize_cmd(exit_config))
        output = self.read_until_pattern(pattern=pattern)
        if self.check_config_mode():
            raise ValueError(u'Failed    to    exit    configuration    mode')
    log.debug(u'exit_config_mode:    {0}'.format(output))
    return output
