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)?
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 PUBLIC_ NETWORK: public_ network( req) get_request( req, path) from_response( response, "network", {})
req_ subnet = self._make_ get_request( req, path)
response_ subnet = req_subnet. get_response( )
net[ "subnet_ info"] = self.get_ from_response(
response_ subnet, "subnet", {})
:param id: net identification
"""
if id == os_helpers.
id = self._get_
path = "/networks/%s" % id
req = self._make_
response = req.get_response()
net = self.get_
# subnet
if "subnets" in net:
path = "/subnets/%s" % net["subnets"][0]
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)?