'Handle ASA reaching privilege level 15 using login
twb-dc-fw1> login
Username: admin
Password: ************'

def asa_login(self):

    delay_factor = self.select_delay_factor(0)
    i = 1
    max_attempts = 50
    self.write_channel(u'login\n')
    while (i <= max_attempts):
        time.sleep((0.5 * delay_factor))
        output = self.read_channel()
        if (u'sername' in output):
            self.write_channel((self.username + u'\n'))
        elif (u'ssword' in output):
            self.write_channel((self.password + u'\n'))
        elif (u'#' in output):
            break
        else:
            self.write_channel(u'login\n')
        i += 1
