From: Boris Ranto Date: Mon, 26 Jun 2017 12:30:38 +0000 (+0200) Subject: collectors: Pass through keyword arguments X-Git-Tag: v1.0~65^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5899e3f5026e0d76aed01ec260ccc43ba8e66e29;p=cephmetrics.git 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 --- 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):