ooi

Comment 1 for bug 1709249

Revision history for this message
Alvaro Lopez (aloga) wrote :

The problem is in this method from ooi/api/helpers_neutron.py

    def get_network_details(self, req, id):
        """Get info from a network.

        It returns json code from the server

        :param req: the incoming network
        :param id: net identification
        """
        if id == os_helpers.PUBLIC_NETWORK:
            id = self._get_public_network(req)
        path = "/networks/%s" % id
        req = self._make_get_request(req, path)
        response = req.get_response()
        net = self.get_from_response(response, "network", {})
        # subnet
        if "subnets" in net:
            path = "/subnets/%s" % net["subnets"][0]
            req_subnet = self._make_get_request(req, path)
            response_subnet = req_subnet.get_response()
            net["subnet_info"] = self.get_from_response(
                response_subnet, "subnet", {})

        ooi_networks = self._build_networks([net])

        return ooi_networks[0]

The conditional there is requesting information from each of the
subnets, even if the user does not have access to them (as it may be in
the case of a external and not shared network).

Should we just remove the subnet listing in this case (maybe catch the exception and skip that subnet)?