Merge "Add extra_configs in SegmentPort api"

This commit is contained in:
Zuul 2020-08-06 10:15:01 +00:00 committed by Gerrit Code Review
commit 223333b75e
3 changed files with 13 additions and 1 deletions

View File

@ -149,6 +149,7 @@ NSX_VERSION_2_3_0 = '2.3.0'
NSX_VERSION_2_4_0 = '2.4.0'
NSX_VERSION_2_5_0 = '2.5.0'
NSX_VERSION_3_0_0 = '3.0.0'
NSX_VERSION_3_0_2 = '3.0.2'
NSX_VERSION_3_1_0 = '3.1.0'
# Features available depending on the NSX Manager backend version

View File

@ -1173,13 +1173,18 @@ class SegmentPortDef(ResourceDef):
arg_name='init_state')
self._set_attr_if_specified(body, 'init_state')
if (self.has_attr('extra_configs') and
self._version_dependant_attr_supported('extra_configs')):
self._set_attr_if_specified(body, 'extra_configs')
return body
@property
def version_dependant_attr_map(self):
return {'hyperbus_mode': nsx_constants.NSX_VERSION_3_0_0,
'admin_state': nsx_constants.NSX_VERSION_3_0_0,
'init_state': nsx_constants.NSX_VERSION_3_1_0}
'init_state': nsx_constants.NSX_VERSION_3_1_0,
'extra_configs': nsx_constants.NSX_VERSION_3_0_2}
class SegmentBindingMapDefBase(ResourceDef):

View File

@ -2153,6 +2153,7 @@ class NsxPolicySegmentPortApi(NsxPolicyResourceBase):
hyperbus_mode=IGNORE,
admin_state=IGNORE,
init_state=IGNORE,
extra_configs=IGNORE,
tags=IGNORE,
tenant=constants.POLICY_INFRA_TENANT):
@ -2171,6 +2172,7 @@ class NsxPolicySegmentPortApi(NsxPolicyResourceBase):
hyperbus_mode=hyperbus_mode,
admin_state=admin_state,
init_state=init_state,
extra_configs=extra_configs,
tags=tags,
tenant=tenant)
self._create_or_store(port_def)
@ -2201,6 +2203,7 @@ class NsxPolicySegmentPortApi(NsxPolicyResourceBase):
address_bindings=IGNORE,
hyperbus_mode=IGNORE,
admin_state=IGNORE,
extra_configs=IGNORE,
tags=IGNORE,
tenant=constants.POLICY_INFRA_TENANT):
@ -2211,6 +2214,7 @@ class NsxPolicySegmentPortApi(NsxPolicyResourceBase):
address_bindings=address_bindings,
hyperbus_mode=hyperbus_mode,
admin_state=admin_state,
extra_configs=extra_configs,
tags=tags,
tenant=tenant)
@ -2247,6 +2251,7 @@ class NsxPolicySegmentPortApi(NsxPolicyResourceBase):
context_id=None,
traffic_tag=None,
hyperbus_mode=IGNORE,
extra_configs=IGNORE,
tags=IGNORE,
tenant=constants.POLICY_INFRA_TENANT):
@ -2259,6 +2264,7 @@ class NsxPolicySegmentPortApi(NsxPolicyResourceBase):
context_id=context_id,
traffic_tag=traffic_tag,
hyperbus_mode=hyperbus_mode,
extra_configs=extra_configs,
tags=tags,
tenant=tenant)