Skip to content

Commit 078207e

Browse files
authored
Merge pull request #88 from wdpypere/bugski
fix bug in nagios exception logging
2 parents eeec84e + 645eb1a commit 078207e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/vsc/utils/nagios.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def parse(self, nrange):
198198
end = float(end)
199199
except ValueError as exc:
200200
msg = f"Invalid end value {end}"
201-
self.log.Exception("msg")
201+
self.log.exception("msg")
202202
raise ValueError(msg) from exc
203203

204204
neg = res['neg'] is not None
@@ -214,7 +214,7 @@ def range_fn(test):
214214
test = float(test)
215215
except ValueError as exc:
216216
msg = f"range_fn: can't convert test {test} (type {type(test)}) to float"
217-
self.log.Exception(msg)
217+
self.log.exception(msg)
218218
raise ValueError(msg) from exc
219219

220220
start_res = True # default: -inf < test
@@ -312,7 +312,7 @@ def cache(self, nagios_exit, nagios_message):
312312
except (IOError, OSError) as exc:
313313
# raising an error is ok, since we usually do this as the very last thing in the script
314314
msg = f"Cannot save to the nagios gzipped JSON file ({self.filename})"
315-
self.log.Exception(msg)
315+
self.log.exception(msg)
316316
raise OSError(msg) from exc
317317

318318
try:
@@ -330,7 +330,7 @@ def cache(self, nagios_exit, nagios_message):
330330
self.filename, self.nagios_username)
331331
except (OSError, FileNotFoundError) as exc:
332332
msg = f"Cannot chown the nagios check file {self.filename} to the nagios user"
333-
self.log.Exception(msg)
333+
self.log.exception(msg)
334334
raise(OSError(msg)) from exc
335335

336336
return True

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
]
4242

4343
PACKAGE = {
44-
'version': '2.2.1',
44+
'version': '2.2.2',
4545
'author': [ag, sdw],
4646
'maintainer': [ag, sdw],
4747
'excluded_pkgs_rpm': ['vsc', 'vsc.utils'], # vsc is default, vsc.utils is provided by vsc-base

0 commit comments

Comments
 (0)