Skip to content

Commit

Permalink
Merge pull request #789 from telefonicaid/fix/error_retrieving_token_…
Browse files Browse the repository at this point in the history
…callback_twice

do not invoke callback two times when error about trust not found in trustConf
  • Loading branch information
fgalan authored Jul 17, 2024
2 parents f118a3b + efbc2d5 commit 0016fe4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix: do not invoke calback twice when error about trust not found in trustConf (#790)
4 changes: 2 additions & 2 deletions lib/models/keystone.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ function getToken(trust, callback) {

// check trust was found or log it
if (!trustConf) {
logger.error('Trust %s not found in configTrust file with content %s', trust, configTrust);
callback(new errors.TokenRetrievalError(trust, 'trust not found' + trust));
logger.error('Trust %s not found in configTrust file', trust);
throw errors.TokenRetrievalError(trust, 'trust not found' + trust);
}
var options = {
url: 'http://' + trustConf.host + ':' + trustConf.port + '/v3/auth/tokens',
Expand Down
2 changes: 1 addition & 1 deletion lib/models/updateAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ function makeTokenListenerFunc(action, event, version, callback) {
if (error || !token) {
return callback(error);
} else {
logger.debug('tokenHandlerFunc retrying with', token);
logger.debug('tokenHandlerFunc retrying with %s', token);
return doRequestV2(action, event, token, function cbDoReqUpdAxn(error, data) {
callback(error, data);
});
Expand Down

0 comments on commit 0016fe4

Please sign in to comment.