'Retrieve data from Aruba Access Point and return parsed result.'

def get_aruba_data(self):

    import pexpect
    connect = 'ssh    {}@{}'
    ssh = pexpect.spawn(connect.format(self.username, self.host))
    query = ssh.expect(['password:', pexpect.TIMEOUT, pexpect.EOF, 'continue    connecting    (yes/no)?', 'Host    key    verification    failed.', 'Connection    refused', 'Connection    timed    out'], timeout=120)
    if (query == 1):
        _LOGGER.error('Timeout')
        return
    elif (query == 2):
        _LOGGER.error('Unexpected    response    from    router')
        return
    elif (query == 3):
        ssh.sendline('yes')
        ssh.expect('password:')
    elif (query == 4):
        _LOGGER.error('Host    key    changed')
        return
    elif (query == 5):
        _LOGGER.error('Connection    refused    by    server')
        return
    elif (query == 6):
        _LOGGER.error('Connection    timed    out')
        return
    ssh.sendline(self.password)
    ssh.expect('#')
    ssh.sendline('show    clients')
    ssh.expect('#')
    devices_result = ssh.before.split('\r\n')
    ssh.sendline('exit')
    devices = {}
    for device in devices_result:
        match = _DEVICES_REGEX.search(device.decode('utf-8'))
        if match:
            devices[match.group('ip')] = {'ip': match.group('ip'), 'mac': match.group('mac').upper(), 'name': match.group('name')}
    return devices
