Also catch keystoneauth1.exceptions.catalog.EndpointNotFound
When generating the ansible inventory and querying for heat or neutron data, keystoneauth1.exceptions.catalog.EndpointNotFound also needs to be caught as an exception in the case either service is not installed and the endpoints do not exist. Change-Id: Ia6de5fc45cdcc5725b1177092e9acf00abf7ab1c Signed-off-by: James Slagle <jslagle@redhat.com>
This commit is contained in:
parent
d06c1503e4
commit
b6e5fbcbad
|
@ -24,6 +24,7 @@ import tempfile
|
|||
import yaml
|
||||
|
||||
from heatclient.exc import HTTPNotFound
|
||||
import keystoneauth1
|
||||
import openstack
|
||||
|
||||
from tripleo_common import exception
|
||||
|
@ -275,7 +276,8 @@ class TripleoInventory(object):
|
|||
try:
|
||||
environment = self.hclient.stacks.environment(self.plan_name)
|
||||
return environment
|
||||
except HTTPNotFound:
|
||||
except (HTTPNotFound,
|
||||
keystoneauth1.exceptions.catalog.EndpointNotFound):
|
||||
return {}
|
||||
|
||||
UNDERCLOUD_SERVICES = [
|
||||
|
@ -301,7 +303,8 @@ class TripleoInventory(object):
|
|||
return None
|
||||
try:
|
||||
stack = self.hclient.stacks.get(self.plan_name)
|
||||
except HTTPNotFound:
|
||||
except (HTTPNotFound,
|
||||
keystoneauth1.exceptions.catalog.EndpointNotFound):
|
||||
stack = None
|
||||
|
||||
return stack
|
||||
|
@ -477,7 +480,8 @@ class TripleoInventory(object):
|
|||
"Disabling use of neutron as a source for inventory "
|
||||
"generation.")
|
||||
return None
|
||||
except openstack.connection.exceptions.EndpointNotFound:
|
||||
except (openstack.connection.exceptions.EndpointNotFound,
|
||||
keystoneauth1.exceptions.catalog.EndpointNotFound):
|
||||
LOG.warning("Neutron service not installed. Disabling use of "
|
||||
"neutron as a source for inventory generation.")
|
||||
return None
|
||||
|
|
Loading…
Reference in New Issue