Skip to content

Commit f86b8ae

Browse files
committed
cleanup
1 parent 4e35469 commit f86b8ae

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

lib/vsc/utils/cache.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ def update(self, key, data, threshold=None):
8383
@param data: whatever needs to be stored
8484
@param threshold: time in seconds
8585
"""
86-
#old_timestamp, old_data = self.get(key, default=(None, None))
8786
now = time.time()
8887
stored = self.set(key=key, value=(now, data), expire=threshold)
8988

lib/vsc/utils/nagios.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,15 +259,15 @@ def __init__(self, header, filename, threshold, nagios_username="nagios", world_
259259
self.nagios_username = nagios_username
260260

261261
def report_and_exit(self):
262-
"""Unzips the cache file and reads the JSON data back in, prints the data and exits accordingly.
262+
"""Reads the cache, prints the data and exits accordingly.
263263
264264
If the cache data is too old (now - cache timestamp > self.threshold), a critical exit is produced.
265265
"""
266266
try:
267-
nagios_cache = FileCache(self.filename, True)
267+
nagios_cache = FileCache(self.filename)
268268
except (IOError, OSError):
269269
logging.critical("Error opening file %s for reading", self.filename)
270-
unknown_exit("%s nagios gzipped JSON file unavailable (%s)" % (self.header, self.filename))
270+
unknown_exit("%s nagios cache unavailable (%s)" % (self.header, self.filename))
271271

272272
(timestamp, nagios_exit_info) = nagios_cache.load('nagios')
273273

@@ -296,7 +296,7 @@ def cache(self, nagios_exit, nagios_message):
296296
logging.info("Wrote nagios check cache file %s at about %s", self.filename, time.ctime(time.time()))
297297
except (IOError, OSError):
298298
# raising an error is ok, since we usually do this as the very last thing in the script
299-
logging.error("Cannot save to the nagios gzipped JSON file (%s)", self.filename)
299+
logging.error("Cannot save to the nagios cache (%s)", self.filename)
300300
raise Exception()
301301

302302
try:

0 commit comments

Comments
 (0)