Skip to content

Commit

Permalink
[(nobranch,rebasingWFCORE-6503)]: [WFCORE-6503]: Adding warning if YA…
Browse files Browse the repository at this point in the history
…ML is adding an existing resource without any attribute.

Signed-off-by: Emmanuel Hugonnet <[email protected]>
  • Loading branch information
ehsavoie committed Mar 1, 2024
1 parent 0ffdfe4 commit 5f3fbd9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3682,7 +3682,7 @@ OperationFailedRuntimeException capabilityAlreadyRegisteredInContext(String capa
IllegalArgumentException noResourceForUndefiningAttribute(String attribute, String address);

@LogMessage(level = WARN)
@Message(id = 490, value = "You have defined a resource for address %s without any attributes, doing nothing")
@Message(id = 490, value = " A YAML resource has been defined for the address %s without any attributes. No actions will be taken.")
void noAttributeSetForAddress(String address);

@LogMessage(level = WARN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ private void processResource(PathAddress parentAddress, Map<String, Object> yaml
//we are processing an attribute:
MGMT_OP_LOGGER.debugf("We are processing the attribute %s for address %s", name, address.getParent().toCLIStyleString());
processAttribute(parentAddress, rootRegistration, name, value, postExtensionOps, xmlOperations);
} else if (value == null) {
MGMT_OP_LOGGER.noAttributeSetForAddress(address.toCLIStyleString());
}
}
} else {
Expand Down

0 comments on commit 5f3fbd9

Please sign in to comment.