Create entry with a list of plain string as group

Change-Id: Ib1a7ebdf6977b78dfbf25606b1f455869c254f2d
This commit is contained in:
lxiaopei 2020-09-02 06:14:20 +08:00
parent bcb3210760
commit 0d263ec65e
1 changed files with 13 additions and 2 deletions

View File

@ -3417,12 +3417,22 @@ class NsxPolicySecurityPolicyBaseApi(NsxPolicyResourceBase):
direction=nsx_constants.IN_OUT,
logged=False, tag=None,
service_entries=IGNORE,
tenant=constants.POLICY_INFRA_TENANT):
tenant=constants.POLICY_INFRA_TENANT,
plain_groups=False):
"""Create CommunicationMap Entry.
source_groups/dest_groups should be a list of group ids belonging
to the domain.
plain_groups should be True if source_groups/dest_groups is a list
of group paths and IP addresses. IP address support from NSX 3.0.0.
"""
if (version.LooseVersion(self.version) <
version.LooseVersion(nsx_constants.NSX_VERSION_3_0_0) and
plain_groups):
err_msg = _("plain_groups support is from NSX 3.0.0")
raise exceptions.NsxLibInvalidInput(error_message=err_msg)
# get the next available sequence number
if not sequence_number:
last_sequence = self._get_last_seq_num(domain_id, map_id,
@ -3447,7 +3457,8 @@ class NsxPolicySecurityPolicyBaseApi(NsxPolicyResourceBase):
logged=logged,
tag=tag,
service_entries=service_entries,
tenant=tenant)
tenant=tenant,
plain_groups=plain_groups)
self._create_or_store(entry_def)
return entry_id