Skip to content

Commit 0d6a913

Browse files
authored
Merge pull request #33 from absolutejam/bugfix/event_settings
Corrects vars in bail()
2 parents 1a5d90d + e777061 commit 0d6a913

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
44
This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md)
55

66
## [Unreleased]
7+
- Fixes `client_name` in `bail()` as it was using an incorrect path within `event` dict (@absolutejam)
78

89
# [0.4.1]
910
## Fixed

sensu_plugin/handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ def bail(self, msg):
103103
'''
104104
Gracefully terminate with message
105105
'''
106-
client_name = self.event.get('client', 'error:no-client-name')
107-
check_name = self.event['client'].get('name', 'error:no-check-name')
106+
client_name = self.event['client'].get('name', 'error:no-client-name')
107+
check_name = self.event['check'].get('name', 'error:no-check-name')
108108
print('{}: {}/{}'.format(msg, client_name, check_name))
109109
sys.exit(0)
110110

0 commit comments

Comments
 (0)