From ed816b5d28b7b58b2b18bf62f4c71714ebe53bd7 Mon Sep 17 00:00:00 2001 From: Adit Sarfaty Date: Sun, 2 Jul 2017 10:17:21 +0300 Subject: [PATCH] AdminUtils NSX|V: router recreate fix type check Fix the verification of unsupported distributed routers type Change-Id: Ia77ee0945e672bfafd81672308ac4f279829d2cb --- vmware_nsx/shell/admin/plugins/nsxv/resources/routers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vmware_nsx/shell/admin/plugins/nsxv/resources/routers.py b/vmware_nsx/shell/admin/plugins/nsxv/resources/routers.py index fe238ee194..a5db04de2a 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv/resources/routers.py +++ b/vmware_nsx/shell/admin/plugins/nsxv/resources/routers.py @@ -104,12 +104,12 @@ def nsx_recreate_router_edge(resource, event, trigger, **kwargs): # all the routers on the same edge have the same type, so it # is ok to check the type once example_router = plugin.get_router(context, router_ids[0]) - router_driver = plugin._router_managers.get_tenant_router_driver( - context, example_router['router_type']) - if router_driver.get_type() == "distributed": + if example_router.get('distributed'): LOG.error("Recreating a distributed driver edge is not " "supported") return + router_driver = plugin._router_managers.get_tenant_router_driver( + context, example_router['router_type']) # load all the routers before deleting their binding routers = []