Merge "Update L3 codes due to API changes"
This commit is contained in:
commit
4b57fc37ab
@ -29,11 +29,13 @@ LOG = log.getLogger(__name__)
|
||||
# Router logical port types
|
||||
LROUTERPORT_UPLINK = "LogicalRouterUplinkPort"
|
||||
LROUTERPORT_DOWNLINK = "LogicalRouterDownLinkPort"
|
||||
LROUTERPORT_LINK = "LogicalRouterLinkPort"
|
||||
LROUTERPORT_LINKONTIER0 = "LogicalRouterLinkPortOnTIER0"
|
||||
LROUTERPORT_LINKONTIER1 = "LogicalRouterLinkPortOnTIER1"
|
||||
|
||||
LROUTER_TYPES = [LROUTERPORT_UPLINK,
|
||||
LROUTERPORT_DOWNLINK,
|
||||
LROUTERPORT_LINK]
|
||||
LROUTERPORT_LINKONTIER0,
|
||||
LROUTERPORT_LINKONTIER1]
|
||||
|
||||
|
||||
def get_edge_cluster(edge_cluster_uuid):
|
||||
@ -191,7 +193,11 @@ def create_logical_router_port(logical_router_id,
|
||||
body['subnets'] = address_groups
|
||||
if resource_type in [LROUTERPORT_UPLINK,
|
||||
LROUTERPORT_DOWNLINK]:
|
||||
body['linked_logical_switch_port_id'] = logical_port_id
|
||||
body['linked_logical_switch_port_id'] = {
|
||||
'target_id': logical_port_id}
|
||||
elif resource_type == LROUTERPORT_LINKONTIER1:
|
||||
body['linked_logical_router_port_id'] = {
|
||||
'target_id': logical_port_id}
|
||||
elif logical_port_id:
|
||||
body['linked_logical_router_port_id'] = logical_port_id
|
||||
if edge_cluster_member_index:
|
||||
@ -232,7 +238,7 @@ def get_tier1_logical_router_link_port(logical_router_id):
|
||||
logical_router_ports = get_logical_router_ports_by_router_id(
|
||||
logical_router_id)
|
||||
for port in logical_router_ports:
|
||||
if port['resource_type'] == LROUTERPORT_LINK:
|
||||
if port['resource_type'] == LROUTERPORT_LINKONTIER1:
|
||||
return port
|
||||
raise nsx_exc.ResourceNotFound(
|
||||
manager=client._get_manager_ip(),
|
||||
|
@ -78,7 +78,7 @@ def add_router_link_port(tier1_uuid, tier0_uuid, edge_members):
|
||||
# Create Tier0 logical router link port
|
||||
tier0_link_port = nsxlib.create_logical_router_port(
|
||||
tier0_uuid, display_name=TIER0_ROUTER_LINK_PORT_NAME,
|
||||
resource_type=nsxlib.LROUTERPORT_LINK,
|
||||
resource_type=nsxlib.LROUTERPORT_LINKONTIER0,
|
||||
logical_port_id=None,
|
||||
address_groups=None)
|
||||
linked_logical_port_id = tier0_link_port['id']
|
||||
@ -88,7 +88,7 @@ def add_router_link_port(tier1_uuid, tier0_uuid, edge_members):
|
||||
# Create Tier1 logical router link port
|
||||
nsxlib.create_logical_router_port(
|
||||
tier1_uuid, display_name=TIER1_ROUTER_LINK_PORT_NAME,
|
||||
resource_type=nsxlib.LROUTERPORT_LINK,
|
||||
resource_type=nsxlib.LROUTERPORT_LINKONTIER1,
|
||||
logical_port_id=linked_logical_port_id,
|
||||
address_groups=None,
|
||||
edge_cluster_member_index=edge_cluster_member_index)
|
||||
@ -113,7 +113,7 @@ def update_advertisement(logical_router_id, advertise_route_nat,
|
||||
return nsxlib.update_logical_router_advertisement(
|
||||
logical_router_id,
|
||||
advertise_nat_routes=advertise_route_nat,
|
||||
advertise_connected_routes=advertise_route_connected)
|
||||
advertise_nsx_connected_routes=advertise_route_connected)
|
||||
|
||||
|
||||
def delete_gw_snat_rule(logical_router_id, gw_ip):
|
||||
|
Loading…
x
Reference in New Issue
Block a user