Skip to content

Commit bc00b4a

Browse files
author
Erwin Dondorp
committed
handle the output of some really old minions
1 parent d6c8137 commit bc00b4a

5 files changed

Lines changed: 27 additions & 5 deletions

File tree

saltgui/static/scripts/issues/State.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,13 @@ export class StateIssues extends Issues {
103103
continue;
104104
}
105105
const tr = Issues.addIssue(pPanel, "state", key);
106-
Issues.addIssueMsg(tr, "State '" + stateData.__sls__ + "/" + stateData.__id__ + "' on '" + minionId + "' failed");
107-
Issues.addIssueCmd(tr, "Apply state", minionId, ["state.sls_id", stateData.__id__, "mods=", stateData.__sls__]);
106+
if (stateData.__sls__) {
107+
Issues.addIssueMsg(tr, "State '" + stateData.__sls__ + "/" + stateData.__id__ + "' on '" + minionId + "' failed");
108+
Issues.addIssueCmd(tr, "Apply state", minionId, ["state.sls_id", stateData.__id__, "mods=", stateData.__sls__]);
109+
} else {
110+
// really old minions do not fill __sls__
111+
Issues.addIssueMsg(tr, "State '" + stateData.__id__ + "' on '" + minionId + "' failed");
112+
}
108113
Issues.addIssueNav(tr, "job", {"id": jobData.jid, "minionid": minionId});
109114
}
110115
}

saltgui/static/scripts/output/Output.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,21 +357,24 @@ export class Output {
357357
}
358358

359359
static _getIsSuccess (pMinionResponse) {
360-
if (Output._hasProperties(pMinionResponse, ["retcode", "return", "success"])) {
360+
// really old minions do not return 'retcode'
361+
if (Output._hasProperties(pMinionResponse, ["return", "success"])) {
361362
return pMinionResponse.success;
362363
}
363364
return true;
364365
}
365366

366367
static _getRetCode (pMinionResponse) {
367-
if (Output._hasProperties(pMinionResponse, ["retcode", "return", "success"])) {
368+
// but really old minions do not return 'retcode'
369+
if (Output._hasProperties(pMinionResponse, ["return", "success"])) {
368370
return pMinionResponse.retcode;
369371
}
370372
return 0;
371373
}
372374

373375
static _getMinionResponse (pCommand, pMinionResponse) {
374-
if (Output._hasProperties(pMinionResponse, ["retcode", "return", "success"])) {
376+
// really old minions do not return 'retcode'
377+
if (Output._hasProperties(pMinionResponse, ["return", "success"])) {
375378
return pMinionResponse.return;
376379
}
377380
if (pCommand.startsWith("runner.") && pMinionResponse && pMinionResponse["return"] !== undefined) {

saltgui/static/scripts/panels/BeaconsMinion.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ export class BeaconsMinionPanel extends Panel {
106106
}
107107

108108
const beacons0 = pLocalBeaconsListData.return[0][pMinionId];
109+
// because some really old minion do not support beacons
110+
if (this.showErrorRowInstead(beacons0)) {
111+
this.setPlayPauseButton("none");
112+
this.updateFooter();
113+
return;
114+
}
109115

110116
const beacons = BeaconsPanel.fixBeaconsMinion(beacons0);
111117

saltgui/static/scripts/panels/Jobs.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ export class JobsPanel extends Panel {
180180
this._hideJobs.push("wheel.key.list_all");
181181
this._hideJobs.push("wheel.key.reject");
182182

183+
// this was automatically executed by really old minions
184+
this._hideJobs.push("mine.update");
185+
183186
let numberOfJobsShown = 0;
184187
let numberOfJobsEligible = 0;
185188
const numberOfJobsPresent = jobs.length;

saltgui/static/scripts/panels/SchedulesMinion.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ export class SchedulesMinionPanel extends Panel {
4949
}
5050

5151
let schedules = pLocalScheduleList.return[0][pMinionId];
52+
// because some really old minion do not fully support schedules
53+
if (this.showErrorRowInstead(schedules)) {
54+
return;
55+
}
56+
5257
schedules = SchedulesPanel.fixSchedulesMinion(schedules);
5358

5459
this.schedulesEnabled = schedules.enabled;

0 commit comments

Comments
 (0)