From 5899e3f5026e0d76aed01ec260ccc43ba8e66e29 Mon Sep 17 00:00:00 2001 From: Boris Ranto Date: Mon, 26 Jun 2017 14:30:38 +0200 Subject: [PATCH] collectors: Pass through keyword arguments We need this to pass through the log_level keyword argument to the base class. Otherwise, the collectd will fail because these classes get unknown argument log_level. Signed-off-by: Boris Ranto --- collectors/mon.py | 3 +++ collectors/osd.py | 4 ++-- collectors/rgw.py | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/collectors/mon.py b/collectors/mon.py index 0593ff3..6e1f5b8 100644 --- a/collectors/mon.py +++ b/collectors/mon.py @@ -104,6 +104,9 @@ class Mon(BaseCollector): all_metrics = merge_dicts(all_metrics, osd_metrics) all_metrics = merge_dicts(all_metrics, mon_states) + def __init__(self, *args, **kwargs): + BaseCollector.__init__(self, *args, **kwargs) + def _mon_command(self, cmd_request): """ Issue a command to the monitor """ diff --git a/collectors/osd.py b/collectors/osd.py index 809eb94..684e54d 100644 --- a/collectors/osd.py +++ b/collectors/osd.py @@ -13,8 +13,8 @@ class OSDs(BaseCollector): all_metrics = merge_dicts(Disk.metrics, IOstat.metrics) - def __init__(self, cluster_name): - BaseCollector.__init__(self, cluster_name) + def __init__(self, cluster_name, **kwargs): + BaseCollector.__init__(self, cluster_name, **kwargs) self.timestamp = int(time.time()) self.osd = {} # dict of disk objects, each disk contains osd_id diff --git a/collectors/rgw.py b/collectors/rgw.py index adceae2..ea8aada 100644 --- a/collectors/rgw.py +++ b/collectors/rgw.py @@ -35,8 +35,8 @@ class RGW(BaseCollector): all_metrics = merge_dicts(simple_metrics, latencies) - def __init__(self, cluster_name, admin_socket): - BaseCollector.__init__(self, cluster_name, admin_socket) + def __init__(self, cluster_name, admin_socket, **kwargs): + BaseCollector.__init__(self, cluster_name, admin_socket, **kwargs) self.host_name = get_hostname() def _get_rgw_data(self): -- 2.47.3