]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/influx: Only split string on first occurence of dot (.) 21965/head
authorWido den Hollander <wido@42on.com>
Thu, 3 May 2018 10:11:58 +0000 (12:11 +0200)
committerPrashant D <pdhange@redhat.com>
Mon, 14 May 2018 01:21:50 +0000 (21:21 -0400)
Service names are not always osd.X or mon.X, they might be
rgw.radosgw.rgw1

This would lead to:

  Unhandled exception from module 'influx' while running on mgr.mon01: too many values to unpack

Only split on the first dot as the rest is the service name

Fixes: http://tracker.ceph.com/issues/23996
Signed-off-by: Wido den Hollander <wido@42on.com>
(cherry picked from commit bd7d0fc16a90b3fefadc2d6904180a7fd04ef5eb)

src/pybind/mgr/influx/module.py

index adeb452701d81394df5fc2a5e540de4a98f7d0d5..bc66fff96d59448a58d450fed0a55a796ed59cf4 100644 (file)
@@ -72,7 +72,7 @@ class Module(MgrModule):
         data = []
 
         for daemon, counters in self.get_all_perf_counters().iteritems():
-            svc_type, svc_id = daemon.split(".")
+            svc_type, svc_id = daemon.split(".", 1)
             metadata = self.get_metadata(svc_type, svc_id)
 
             for path, counter_info in counters.items():