MCPcopy Create free account
hub / github.com/apache/cloudstack / split_ips_by_family

Function split_ips_by_family

scripts/vm/network/security_group.py:134–146  ·  view source on GitHub ↗
(ips)

Source from the content-addressed store, hash-verified

132
133
134def split_ips_by_family(ips):
135 if type(ips) is str:
136 ips = [ip for ip in ips.split(';') if ip != '']
137
138 ip4s = []
139 ip6s = []
140 for ip in ips:
141 network = ipaddress.ip_network(ip)
142 if network.version == 4:
143 ip4s.append(ip)
144 elif network.version == 6:
145 ip6s.append(ip)
146 return ip4s, ip6s
147
148def destroy_network_rules_for_nic(vm_name, vm_ip, vm_mac, vif, sec_ips):
149 try:

Callers 2

default_network_rulesFunction · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected