Skip to content

Commit

Permalink
replace yaml.safeLoad w/yaml.load to match update
Browse files Browse the repository at this point in the history
Signed-off-by: David Huffman <dshuffma@us.ibm.com>
  • Loading branch information
dshuffma-ibm committed Sep 26, 2023
1 parent a441dbb commit ea0c062
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/athena/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function _load_config(file_name) {
}
} else {
try { // use yaml ib if its not json
return tools.yaml.safeLoad(tools.fs.readFileSync(file_name, 'utf8'));
return tools.yaml.load(tools.fs.readFileSync(file_name, 'utf8'));
} catch (e) {
console.error('Error - Unable to load yaml configuration file', file_name);
console.error(e);
Expand Down
3 changes: 2 additions & 1 deletion packages/athena/json_docs/default_settings_doc.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@
"mustgather_enabled": false,
"read_only_enabled": false,
"osnadmin_feats_enabled": true,
"migration_enabled": false
"migration_enabled": false,
"audit_logging_enabled": true
},
"file_logging": {
"client": {
Expand Down
6 changes: 3 additions & 3 deletions packages/athena/libs/other_apis_lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ module.exports = function (logger, ev, t) {
config_file = JSON.parse(config_file);

} else {
config_file = t.yaml.safeLoad(config_file); // if its yaml, load it with the yaml lib
config_file = t.yaml.load(config_file); // if its yaml, load it with the yaml lib
}
} catch (e) {
logger.error('[other] could not parse config file', e);
Expand Down Expand Up @@ -727,7 +727,7 @@ module.exports = function (logger, ev, t) {
if (process.env.CONFIGURE_FILE.indexOf('.json') >= 0) { // json config file
config_file = JSON.parse(config_file);
} else {
config_file = t.yaml.safeLoad(config_file); // yaml config file
config_file = t.yaml.load(config_file); // yaml config file
}
} catch (e) {
logger.error('[settings edit] could not parse config file', e);
Expand Down Expand Up @@ -833,7 +833,7 @@ module.exports = function (logger, ev, t) {
exports.store_swagger_file = (req, cb) => {
let json = null;
try {
json = t.yaml.safeLoad(req.body);
json = t.yaml.load(req.body);
} catch (e) {
logger.error('[openapi] unable to covert yaml to json:', e);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/athena/libs/validation_lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ module.exports = (logger, ev, t, opts) => {
return thing;
} else {
try {
return t.yaml.safeLoad(thing);
return t.yaml.load(thing);
} catch (e) {
logger.error('[validate] unable to convert yaml to json. e:', e);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/athena/scripts/create_databases.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ module.exports = (logger, t) => {
} else {
try {
const temp = t.fs.readFileSync(t.path.join(__dirname, doc), 'utf8');
fs_doc = t.yaml.safeLoad(temp);
fs_doc = t.yaml.load(temp);
} catch (e) {
logger.error('[db startup] unable to read yaml file. cannot add to database.', doc, e);
return cb_createDocs();
Expand Down
2 changes: 1 addition & 1 deletion packages/athena/test/openapi/init_examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function parse_to_json(thing) {
return thing;
} else {
try {
return yaml.safeLoad(thing);
return yaml.load(thing);
} catch (e) {
console.error('unable to convert yaml to json. e:', e);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/athena/test/openapi/make-openapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function parse_to_json(thing) {
return thing;
} else {
try {
return yaml.safeLoad(thing);
return yaml.load(thing);
} catch (e) {
console.error('unable to convert yaml to json. e:', e);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/athena/test/openapi/response_inspection.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function parse_to_json(thing) {
return thing;
} else {
try {
return yaml.safeLoad(thing);
return yaml.load(thing);
} catch (e) {
console.error('unable to convert yaml to json. e:', e);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/athena/test/openapi/same_same.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function parse_to_json(thing) {
return thing;
} else {
try {
return yaml.safeLoad(thing);
return yaml.load(thing);
} catch (e) {
console.error('unable to convert yaml to json. e:', e);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/athena/test/openapi/unused.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function parse_to_json(thing) {
return thing;
} else {
try {
return yaml.safeLoad(thing);
return yaml.load(thing);
} catch (e) {
console.error('unable to convert yaml to json. e:', e);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/athena/test/test-suites/common-test-framework.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ tools.middleware = require('../../libs/middleware/middleware.js')(logger, ev, to
tools.notifications = require('../../libs/notifications_lib.js')(logger, ev, tools);
tools.ca_lib = require('../../libs/ca_lib.js')(logger, ev, tools);
tools.proxy_lib = require('../../libs/proxy_lib.js')(logger, ev, tools);
tools.config_file = tools.yaml.safeLoad(tools.fs.readFileSync(config_file_location, 'utf8'));
tools.config_file = tools.yaml.load(tools.fs.readFileSync(config_file_location, 'utf8'));
tools.notifications.create = () => { return true; };
tools.user_preferences = require('../../libs/user_preferences_lib.js')(logger, ev, tools);
tools.auth_scheme = require('../../libs/auth_scheme_lib.js')(logger, ev, tools);
Expand Down

0 comments on commit ea0c062

Please sign in to comment.