Skip to content

Commit 1f43a26

Browse files
committed
Remove new environment variable EXIT_ON_FAILURES
Remove newly created environment variable EXIT_ON_FAILURES. st2chatops should be always exit for the case if st2chatops encounters authenticate or unresolved application URL issues with Stackstorm.
1 parent efb8b55 commit 1f43a26

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

CHANGELOG.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ in development
88
-----
99
* Add initial support for Microsoft Teams via BotFramework (new feature)
1010
* Add unit tests for all adapters (improvement)
11-
* Add environment variable `EXIT_ON_FAILURES` to allow `st2chatops` to exit from `st2client` failures.
11+
* Allow `st2chatops` to exit from `st2client` failures.
1212

1313
0.9.2
1414
-----

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ specified when running hubot:
7777
* `ST2_SLACK_FAIL_COLOR` - Slack attachement color for failures either be one of good, warning, danger, or any hex color code (optional).
7878
* `ST2_ROCKETCHAT_SUCCESS_COLOR` - RocketChat attachement color for success, can either be one of good, warning, danger, or any hex color code (optional).
7979
* `ST2_ROCKETCHAT_FAIL_COLOR` - RocketChat attachement color for failures either be one of good, warning, danger, or any hex color code (optional).
80-
* `EXIT_ON_FAILURES` - Exit from st2chatops for st2client failures. Default is `false` (optional).
8180

8281
Note: ``ST2_ROUTE`` environment variable mentioned below should only be
8382
specified if you modified the rule which comes with a ``hubot`` pack to use a

scripts/stackstorm.js

+3-11
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ env.ST2_COMMANDS_RELOAD_INTERVAL = parseInt(env.ST2_COMMANDS_RELOAD_INTERVAL ||
7575
// Cap message length to a certain number of characters.
7676
env.ST2_MAX_MESSAGE_LENGTH = parseInt(env.ST2_MAX_MESSAGE_LENGTH || 500, 10);
7777

78-
// Exit from st2chatops for st2client failures
79-
env.EXIT_ON_FAILURES = env.EXIT_ON_FAILURES || null;
80-
8178
// Constants
8279
// Fun human-friendly commands. Use %s for payload output.
8380
var START_MESSAGES = [
@@ -173,12 +170,7 @@ module.exports = function(robot) {
173170
})
174171
.catch(function (err) {
175172
robot.logger.error('Failed to authenticate: ' + err.message);
176-
177-
if (env.EXIT_ON_FAILURES) {
178-
stop({exit: true});
179-
} else {
180-
throw err;
181-
}
173+
stop({exit: true});
182174
});
183175
}
184176

@@ -422,7 +414,7 @@ module.exports = function(robot) {
422414
});
423415

424416
// Initial command loading
425-
loadCommands({exitOnFailure: env.EXIT_ON_FAILURES});
417+
loadCommands({exitOnFailure: true});
426418

427419
// Add an interval which tries to re-load the commands
428420
commands_load_interval = setInterval(loadCommands.bind(), (env.ST2_COMMANDS_RELOAD_INTERVAL * 1000));
@@ -453,7 +445,7 @@ module.exports = function(robot) {
453445
}
454446

455447
// Authenticate with StackStorm backend and then call start.
456-
// On a failure to authenticate log the error.
448+
// On a failure to authenticate log the error and quit.
457449
return promise.then(function () {
458450
start();
459451
return stop;

0 commit comments

Comments
 (0)