The vmware_nsx.common.securitygroups Module

vmware_nsx.common.securitygroups.get_security_group_rules_nsx_format(session, cluster, security_group_rules, with_id=False)

Convert neutron security group rules into NSX format.

This routine splits Neutron security group rules into two lists, one for ingress rules and the other for egress rules.

vmware_nsx.common.securitygroups.merge_security_group_rules_with_current(session, cluster, new_rules, current_rules)
vmware_nsx.common.securitygroups.remove_security_group_with_id_and_id_field(rules, rule_id)

Remove rule by rule_id.

This function receives all of the current rule associated with a security group and then removes the rule that matches the rule_id. In addition it removes the id field in the dict with each rule since that should not be passed to nsx.