From 7ea11eada552627b5385a6a347f23fccee484e67 Mon Sep 17 00:00:00 2001 From: spisarski Date: Mon, 22 Jan 2018 19:27:31 -0700 Subject: Added password support for SSH and Ansible Additional protections when initializing network resources Enhanced playbook runner variable support Change-Id: Id897c4ece1de706afbc52d0a034ca3bfb68fdce3 Signed-off-by: spisarski --- snaps/openstack/create_router.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'snaps/openstack/create_router.py') 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: -- cgit 1.2.3-korg