Details
-
Bug
-
Status: Resolved
-
Resolution: Done
-
None
-
None
-
None
-
Operating System: All
Platform: All
-
3822
-
High
Description
After a new netconf connector config is POSTED, you can't update it via restconf (nor DELETE or GET). With POST you get "data already exists", which makes sense since POST is create-if-not-exists (although this erroneously worked in Helium).
PUT with, eg, the following URL:
should work but fails with error:
"odl-sal-netconf-connector-cfg:sal-netconf-connector from URI can't be resolved. For key which is of type identityref it should be in format module_name:identity_name."
Clearly "odl-sal-netconf-connector-cfg:sal-netconf-connector" is in the correct format.
The problem is in RestCodec.ObjectCodec#deserialize:
if (type instanceof IdentityrefTypeDefinition) {
if (input instanceof IdentityValuesDTO)
logger.debug("Value is not instance of IdentityrefTypeDefinition but is {}. Therefore NULL is used as translation of - {}",
input == null ? "null" : input.getClass(), String.valueOf(input));
return null;
}
It expects the 'input' value to be of type IdentityValuesDTO but it's a String. In fact the calling code in ControllerContext#addKeyValue specifically treats the value as a String. So there's a disconnect between ControllerContext and RestCodec.ObjectCodec. I'm not sure what the intent is here, ie who is supposed to parse the identityref string into an IdentityValuesDTO instance.
I locally changed ObjectCodec#deserialize to check for instanceof String and parse into an IdentityValuesDTO. This fixed the problem.
Note: with this bug no config module can be updated via restconf, including OOB ones.