diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 6a830f1b..696ca286 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,2 +1,3 @@ +FIX: check ngsi version in configuration handler Add missed global config env vars (IOTA_CONFIG_RETRIEVAL, IOTA_DEFAULT_KEY, IOTA_DEFAULT_TRANSPORT) Update Docker security practices (Add HEALTHCHECK, Use Anonymous User, Use two-stage build) diff --git a/lib/iotaUtils.js b/lib/iotaUtils.js index f6e404c1..0f0afb6c 100644 --- a/lib/iotaUtils.js +++ b/lib/iotaUtils.js @@ -266,14 +266,16 @@ function manageConfiguration(apiKey, deviceId, device, objMessage, sendFunction, } function extractAttributes(results, callback) { - if ( + if (iotAgentLib.configModule.checkNgsi2()) { + callback(null, results); + } else if ( results.contextResponses && results.contextResponses[0] && results.contextResponses[0].contextElement.attributes ) { callback(null, results.contextResponses[0].contextElement.attributes); } else { - callback("Couldn't find any information in Context Broker response"); + callback("Couldn't find any information in Context Broker response: " + JSON.stringify(results)); } }