// First insert the root node corresponding to the new child Resource.
String rootPath = getChildResourceConfigurationRootPath(report.getResourceType(),
report.getResourceConfiguration());
initAugeas();
try {
AugeasNode rootNode = new AugeasNode(rootPath);
if (this.augeas.exists(rootNode.getPath())) {
report.setStatus(CreateResourceStatus.FAILURE);
report.setErrorMessage("An Augeas node already exists with path " + rootPath);
return report;
}
String rootLabel = getChildResourceConfigurationRootLabel(report.getResourceType(),
report.getResourceConfiguration());
this.augeas.set(rootNode.getPath(), rootLabel);
// Then set all its child nodes.
Collection<PropertyDefinition> propDefs = resourceConfigDef.getPropertyDefinitions().values();
for (PropertyDefinition propDef : propDefs) {
setNode(propDef, resourceConfig, this.augeas, rootNode);