'Check if a remote controller is listening at a specific ip and port'

def isListening(self, ip, port):

    listening = self.cmd(('echo    A    |    telnet    -e    A    %s    %d' % (ip, port)))
    if ('Connected' not in listening):
        warn(('Unable    to    contact    the    remote    controller    at    %s:%d\n' % (ip, port)))
        return False
    else:
        return True
