def get_ip(self, name):
        """Get container's ip by name."""
        cmd = "lxc-attach -n %s ip addr list dev eth0" % name
        for attempt in range(1, 16):
            code, stdout = self.server.ssh.execute(cmd)[:2]
            if code:
                continue
            for line in stdout.splitlines():
                m = INET_ADDR_RE.match(line)
                if m:
                    return m.group(1)
            time.sleep(attempt)
        msg = _("Timeout waiting for ip address of container \"%s\"") % name
        raise exceptions.TimeoutException(msg)
dataset/ETHPy150Open openstack/rally/rally/deployment/serverprovider/providers/lxc.py/LxcHost.get_ip/original