diff --git a/vmware_nsxlib/v3/policy/core_resources.py b/vmware_nsxlib/v3/policy/core_resources.py index 2d747ae4..50823404 100644 --- a/vmware_nsxlib/v3/policy/core_resources.py +++ b/vmware_nsxlib/v3/policy/core_resources.py @@ -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