Removes listing of inaccessible subnets
- Related-Bug: 1709249 - WARN when subnet is inaccessible Change-Id: I22fd07025300127d411803d4ea0351eb09c1ce64
This commit is contained in:
parent
8f3a0de485
commit
73e744d6b1
|
@ -14,8 +14,11 @@
|
||||||
|
|
||||||
from ooi.api import helpers
|
from ooi.api import helpers
|
||||||
from ooi import exception
|
from ooi import exception
|
||||||
|
from ooi.log import log as logging
|
||||||
from ooi.openstack import helpers as os_helpers
|
from ooi.openstack import helpers as os_helpers
|
||||||
|
|
||||||
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class OpenStackNeutron(helpers.BaseHelper):
|
class OpenStackNeutron(helpers.BaseHelper):
|
||||||
"""Class to interact with the neutron API."""
|
"""Class to interact with the neutron API."""
|
||||||
|
@ -275,6 +278,7 @@ class OpenStackNeutron(helpers.BaseHelper):
|
||||||
:param req: the incoming network
|
:param req: the incoming network
|
||||||
:param id: net identification
|
:param id: net identification
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if id == os_helpers.PUBLIC_NETWORK:
|
if id == os_helpers.PUBLIC_NETWORK:
|
||||||
id = self._get_public_network(req)
|
id = self._get_public_network(req)
|
||||||
path = "/networks/%s" % id
|
path = "/networks/%s" % id
|
||||||
|
@ -283,11 +287,16 @@ class OpenStackNeutron(helpers.BaseHelper):
|
||||||
net = self.get_from_response(response, "network", {})
|
net = self.get_from_response(response, "network", {})
|
||||||
# subnet
|
# subnet
|
||||||
if "subnets" in net:
|
if "subnets" in net:
|
||||||
|
try:
|
||||||
path = "/subnets/%s" % net["subnets"][0]
|
path = "/subnets/%s" % net["subnets"][0]
|
||||||
req_subnet = self._make_get_request(req, path)
|
req_subnet = self._make_get_request(req, path)
|
||||||
response_subnet = req_subnet.get_response()
|
response_subnet = req_subnet.get_response()
|
||||||
net["subnet_info"] = self.get_from_response(
|
net["subnet_info"] = self.get_from_response(
|
||||||
response_subnet, "subnet", {})
|
response_subnet, "subnet", {})
|
||||||
|
except Exception:
|
||||||
|
LOG.warn(
|
||||||
|
"No details from the requested subnet can be fetched"
|
||||||
|
)
|
||||||
|
|
||||||
ooi_networks = self._build_networks([net])
|
ooi_networks = self._build_networks([net])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue