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

Function removeUndesiredCidrs

systemvm/debian/opt/cloud/bin/configure.py:56–71  ·  view source on GitHub ↗
(cidrs, version)

Source from the content-addressed store, hash-verified

54
55
56def removeUndesiredCidrs(cidrs, version):
57 version_char = ":"
58 if version == 4:
59 version_char = "."
60 if "," in cidrs:
61 cidrList = cidrs.split(",")
62 ipv4Cidrs = []
63 for cidr in cidrList:
64 if version_char not in cidr:
65 ipv4Cidrs.append(cidr)
66 if len(ipv4Cidrs) > 0:
67 return ",".join(ipv4Cidrs)
68 else:
69 if version_char not in cidrs:
70 return cidrs
71 return None
72
73
74def appendStringIfNotEmpty(s1, s2):

Callers 3

__process_routing_ip4Method · 0.85
__process_ip6Method · 0.85
processMethod · 0.85

Calls 2

appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected