Skip to content

Commit

Permalink
check if trust is found in configTrust ad log it
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroVega committed Sep 26, 2023
1 parent af7736f commit 424ea21
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/models/keystone.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ function getToken(trust, callback) {
const host = config.authentication.host;
const port = config.authentication.port;
var trustConf = configTrust.trusts.find((item) => item.id === trust);

// check trust was found or log it
if (!trustConf) {
logger.error('Trust [%s] not found in configTrust file', trust);
callback(new errors.TokenRetrievalError(trust,
'trust not found' + trust)
);
}
var options = {
url: 'http://' + host + ':' + port + '/v3/auth/tokens',
method: 'POST',
Expand Down

0 comments on commit 424ea21

Please sign in to comment.