diff --git a/Changelog.md b/Changelog.md index 32c39090bfc7425b3288c99c6adba55b2a7f2e67..43d7ee17ca70248c1309044be71ae8cc88e2a044 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,9 @@ All notable changes to this project will be documented in this file. +## [0.4] - 2021-08-24 +- bugfix (POL1-492) + ## [0.3] - 2021-08-20 - less strict inventory response validation - gws direct & indirect checks diff --git a/brian_polling_manager/main.py b/brian_polling_manager/main.py index ab837be04feb9235447bee664f800355493088b7..a753961cd9aa60da479c218461dde27b6de08dda 100644 --- a/brian_polling_manager/main.py +++ b/brian_polling_manager/main.py @@ -29,8 +29,8 @@ import click import jsonschema from statsd import StatsClient -from brian_polling_manager \ - import inventory, configuration, interfaces, gws_direct, gws_indirect +from brian_polling_manager import inventory, configuration, \ + interfaces, gws_direct, gws_indirect, sensu logger = logging.getLogger(__name__) @@ -74,6 +74,8 @@ def refresh(config, force=False): :param force: if True, reload inventory data even if timestamp is same :return: a dict, formatted as above """ + sensu.clear_cached_values() + state = configuration.State(config['statedir']) last = inventory.last_update_timestamp(config['inventory']) if force or not last or last != state.last: diff --git a/brian_polling_manager/sensu.py b/brian_polling_manager/sensu.py index b03ec13862c92fb7f1d8d0db4a5a0b3c094c939c..1ac0bf705ca11978dabdc480f7959e1591eec132 100644 --- a/brian_polling_manager/sensu.py +++ b/brian_polling_manager/sensu.py @@ -12,6 +12,11 @@ logger = logging.getLogger(__name__) _cached_checks = None # not using lru_cache, since params is a dict +def clear_cached_values(): + global _cached_checks + _cached_checks = None + + def load_all_checks(params, namespace='default'): global _cached_checks if _cached_checks is not None: diff --git a/setup.py b/setup.py index 3a42b85f51d7e227bd1530c6d66791682acd8b4e..770234eac602ce417fe7afa2a3adb0ae35d815a7 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name='brian-polling-manager', - version="0.3", + version="0.4", author='GEANT', author_email='swd@geant.org', description='service for managing BRIAN polling checks',