// Now see if there's at least one node in this list with an 'ipaddr' value with the same IP address version as
// the PropertyMap.
String ipaddr = propMap.getSimple("ipaddr").getStringValue();
int ipAddressVersion = (ipaddr.indexOf(':') == -1) ? 4 : 6;
for (String canonicalPath : canonicalPaths) {
AugeasNode canonicalNode = new AugeasNode(canonicalPath);
AugeasNode childNode = canonicalNode.getParent();
AugeasNode ipaddrNode = new AugeasNode(childNode, "ipaddr");
String existingIpaddr = augeas.get(ipaddrNode.getPath());
int existingIpAddressVersion = (existingIpaddr.indexOf(':') == -1) ? 4 : 6;
if (existingIpAddressVersion == ipAddressVersion) {
return childNode;
}
}