Skip to content

Commit

Permalink
added try catch on yaml.safeload in shell (#1988)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukew3 authored May 12, 2022
1 parent f743c73 commit 630f286
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/shell/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ if (process.env.OOD_SSHHOST_ALLOWLIST){

let default_sshhost, first_available_host;
glob.sync(path.join((process.env.OOD_CLUSTERS || '/etc/ood/config/clusters.d'), '*.y*ml'))
.map(yml => yaml.safeLoad(fs.readFileSync(yml)))
.map(yml => {
try {
return yaml.safeLoad(fs.readFileSync(yml));
} catch(err) { /** just keep going. dashboard should have an alert about it */}
})
.filter(config => (config.v2 && config.v2.login && config.v2.login.host) && ! (config.v2 && config.v2.metadata && config.v2.metadata.hidden))
.forEach((config) => {
let host = config.v2.login.host; //Already did checking above
Expand Down

0 comments on commit 630f286

Please sign in to comment.