From: Dan Mick Date: Tue, 17 Dec 2019 22:57:54 +0000 (-0800) Subject: mgr/telemetry: split entity_name only once (handle ids with dots) X-Git-Tag: v14.2.8~22^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e9ff205a294cb1ba128e09335d0450f640f026b9;p=ceph.git mgr/telemetry: split entity_name only once (handle ids with dots) 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 (cherry picked from commit 626c7dff0386dfc370d54561ae6bfa9866f2ee33) --- diff --git a/src/pybind/mgr/telemetry/module.py b/src/pybind/mgr/telemetry/module.py index 38442290310..668da555f9b 100644 --- a/src/pybind/mgr/telemetry/module.py +++ b/src/pybind/mgr/telemetry/module.py @@ -334,7 +334,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'))