Skip to content

Commit

Permalink
fixing 1847454, response was actually used to find success/failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Erwin Dondorp committed Aug 16, 2023
1 parent 93036bb commit 97f7a41
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions saltgui/static/scripts/Api.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ export class API {
getLocalTestVersion (pNodegroup) {
const params = {
"client": "local",
"full_return": true,
"fun": "test.version",
"tgt": "N@" + pNodegroup,
"tgt_type": "compound"
Expand Down
10 changes: 6 additions & 4 deletions saltgui/static/scripts/panels/Nodegroups.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export class NodegroupsPanel extends Panel {
const nodegroup = this.todoNodegroups.shift();

// test group membership with function that is typically hidden
// note: uses full_data=true
const localTestVersion = this.api.getLocalTestVersion(nodegroup);
localTestVersion.then((pLocalTestVersionData) => {
const retdata = pLocalTestVersionData.return[0];
Expand All @@ -195,14 +196,15 @@ export class NodegroupsPanel extends Panel {
let offline = 0;
let problems = 0;
for (const minionId of nodelist) {
if (retdata[minionId] === false) {
const minionData = retdata[minionId];
if (minionData === false) {
offline += 1;
} else if (typeof retdata[minionId] === "string") {
} else if (minionData.retcode === 0) {
online += 1;
} else {
// that's an error message
// e.g. unaccepted minion or unknown minion
problems += 1;
} else {
online += 1;
}
}
if (online !== cnt) {
Expand Down

0 comments on commit 97f7a41

Please sign in to comment.