Merge "Expose failover_mode option for T1 Router in MP"

This commit is contained in:
Zuul 2020-01-28 01:40:57 +00:00 committed by Gerrit Code Review
commit ba2cb70e40
2 changed files with 8 additions and 2 deletions

View File

@ -845,6 +845,7 @@ class LogicalRouterTestCase(BaseTestResource):
tier0_router = True
description = 'dummy'
tz_id = 'tz_id'
failover_mode = 'PREEMPTIVE'
allocation_pool = {
'allocation_pool_type': 'LoadBalancerAllocationPool',
'allocation_size': 'SMALL'
@ -854,7 +855,8 @@ class LogicalRouterTestCase(BaseTestResource):
router.create(fake_router['display_name'], None, None,
tier0_router,
description=description, transport_zone_id=tz_id,
allocation_pool=allocation_pool)
allocation_pool=allocation_pool,
failover_mode=failover_mode)
data = {
'display_name': fake_router['display_name'],
@ -862,6 +864,7 @@ class LogicalRouterTestCase(BaseTestResource):
'tags': None,
'description': description,
'advanced_config': {'transport_zone_id': tz_id},
'failover_mode': failover_mode,
'allocation_profile': {
'allocation_pool': allocation_pool
}

View File

@ -766,7 +766,8 @@ class NsxLibLogicalRouter(utils.NsxLibApiBase):
def create(self, display_name, tags, edge_cluster_uuid=None, tier_0=False,
description=None, transport_zone_id=None,
allocation_pool=None, enable_standby_relocation=False):
allocation_pool=None, enable_standby_relocation=False,
failover_mode=None):
# TODO(salv-orlando): If possible do not manage edge clusters
# in the main plugin logic.
router_type = (nsx_constants.ROUTER_TYPE_TIER0 if tier_0 else
@ -781,6 +782,8 @@ class NsxLibLogicalRouter(utils.NsxLibApiBase):
if transport_zone_id:
body['advanced_config'] = {
'transport_zone_id': transport_zone_id}
if failover_mode:
body['failover_mode'] = failover_mode
allocation_profile = {}
if allocation_pool:
allocation_profile['allocation_pool'] = allocation_pool