diff options
Diffstat (limited to 'snaps/openstack/create_router.py')
-rw-r--r-- | snaps/openstack/create_router.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/snaps/openstack/create_router.py b/snaps/openstack/create_router.py index 4f95c3b..c9ccdd6 100644 --- a/snaps/openstack/create_router.py +++ b/snaps/openstack/create_router.py @@ -14,7 +14,7 @@ # limitations under the License. import logging -from neutronclient.common.exceptions import NotFound +from neutronclient.common.exceptions import NotFound, Unauthorized from snaps.config.router import RouterConfig from snaps.openstack.openstack_creator import OpenStackNetworkObject @@ -61,8 +61,12 @@ class OpenStackRouter(OpenStackNetworkObject): """ super(self.__class__, self).initialize() - self.__router = neutron_utils.get_router( - self._neutron, router_settings=self.router_settings) + try: + self.__router = neutron_utils.get_router( + self._neutron, router_settings=self.router_settings) + except Unauthorized as e: + logger.warn('Unable to lookup router with name %s - %s', + self.router_settings.name, e) if self.__router: for internal_subnet_name in self.router_settings.internal_subnets: |