]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/telemetry: split entity_name only once (handle ids with dots) 33094/head
authorDan Mick <dan.mick@redhat.com>
Tue, 17 Dec 2019 22:57:54 +0000 (14:57 -0800)
committerDan Mick <dan.mick@redhat.com>
Wed, 5 Feb 2020 05:45:27 +0000 (21:45 -0800)
If an entity name (id.type) has more than one dot (i.e. 'type' has
dots), split only on the first one

Fixes: https://tracker.ceph.com/issues/43313
Signed-off-by: Dan Mick <dan.mick@redhat.com>
src/pybind/mgr/telemetry/module.py

index 97b353538931373aac7ad1244019793e6f7058c6..f5ef62711c3f1a3a9fb3a0bc4f6bfeebeac3637f 100644 (file)
@@ -330,7 +330,8 @@ class Module(MgrModule):
                 continue
             c = json.loads(crashinfo)
             del c['utsname_hostname']
-            (etype, eid) = c.get('entity_name', '').split('.')
+            # entity_name might have more than one '.', beware
+            (etype, eid) = c.get('entity_name', '').split('.', 1)
             m = hashlib.sha1()
             m.update(self.salt.encode('utf-8'))
             m.update(eid.encode('utf-8'))