From ed7355d4028a93a6f4a7a3687f2748ddb0e90ba8 Mon Sep 17 00:00:00 2001 From: Jeroen van der Heijden Date: Sat, 7 Jan 2023 16:51:55 +0100 Subject: [PATCH] Added netapp, fix allow unknown collectors --- bin/infrasonar | 11 +++++++++-- setup.py | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/infrasonar b/bin/infrasonar index 0b7fc84..160ba03 100755 --- a/bin/infrasonar +++ b/bin/infrasonar @@ -15,7 +15,7 @@ from dataclasses import dataclass from setproctitle import setproctitle from typing import Any, Optional, Dict, List, Tuple -__version__ = '0.1.3' # Update version in setup as well +__version__ = '0.1.4' # Update version in setup as well _labels_example = """ @@ -241,6 +241,9 @@ _collectors = { 'address': (_test_address, ''), 'port': (_test_port, 1433), }, + 'netapp': { + 'address': (_test_address, ''), + }, 'ping': { 'address': (_test_address, ''), 'interval': (_test_interval, 1), @@ -450,6 +453,9 @@ def config_eq(orig, dest, control): if orig == dest: return True + if control is None: + return False + if dest: for key, dval in dest.items(): v = control[key][1] @@ -549,7 +555,8 @@ async def apply_asset(aa: ApplyAssets, dest: dict): key = collector['key'] config = collector.get('config') oc = collector_by_key(orig, key) - if oc and config_eq(oc.get('config'), config, _collectors[key]): + control = _collectors.get(key) + if oc and config_eq(oc.get('config'), config, control): continue changes = make_changes(changes) diff --git a/setup.py b/setup.py index 9b897cb..3969b16 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ setup( name='infrasonar', - version='0.1.3', # Update version in infrasonar as well + version='0.1.4', # Update version in infrasonar as well description='InfraSonar Toolkit', url='https://github.com/infrasonar/toolkit', long_description=long_description,