From 2c9feb35be383c1b4899368e198857f8328874d6 Mon Sep 17 00:00:00 2001 From: Akash Gangil Date: Wed, 17 Aug 2016 06:50:33 -0700 Subject: [PATCH] Expose advertise_static_routes prop from router api A tier-1 logical router allows us to advertise the static routes configured as well. This can be done by setting the advertise_route_static property to True, which is similar to advertise_route_nat, or advertise_route_connected. Until now, the router api client in the code didnt not expose advertise_route_static option. This patch adds that property to the update_advertisement method. We also set the default value to False since, the default value when we create the router is False. So unless someone wants it the default behavious stays the same. Change-Id: Ic56df4fe81ea52e43f05b1ffd0c8fbcde8f00370 --- vmware_nsx/nsxlib/v3/router.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vmware_nsx/nsxlib/v3/router.py b/vmware_nsx/nsxlib/v3/router.py index cbfdc65205..e1d75486c1 100644 --- a/vmware_nsx/nsxlib/v3/router.py +++ b/vmware_nsx/nsxlib/v3/router.py @@ -111,12 +111,16 @@ class RouterLib(object): self._router_port_client.delete(tier1_link_port_id) self._router_port_client.delete(tier0_link_port_id) - def update_advertisement(self, logical_router_id, advertise_route_nat, - advertise_route_connected, enabled=True): + def update_advertisement(self, logical_router_id, + advertise_route_nat, + advertise_route_connected, + advertise_route_static=False, + enabled=True): return self.nsxlib.update_logical_router_advertisement( logical_router_id, advertise_nat_routes=advertise_route_nat, advertise_nsx_connected_routes=advertise_route_connected, + advertise_static_routes=advertise_route_static, enabled=enabled) def delete_gw_snat_rule(self, logical_router_id, gw_ip):