'Checks if the device is in configuration mode or not.
Cisco IOS devices abbreviate the prompt at 20 chars in config mode'

def check_config_mode(self, check_string=u')#', pattern=u''):

    if (not pattern):
        pattern = re.escape(self.base_prompt[:16])
    return super(CiscoBaseConnection, self).check_config_mode(check_string=check_string, pattern=pattern)
