From 92cc71dec8da73bf43d345418b73db1a32a6b8b9 Mon Sep 17 00:00:00 2001 From: momousta Date: Fri, 8 Nov 2019 15:02:07 -0600 Subject: reporting: Using a uuid to enforce uniqueness on the KVP keys. The KVPs currently being emitted to the .kvp_pool file can have duplicate keys which is wrong since these keys should be unique. The situation can occur if for example one azure function called twice or more and this function is reporting telemetry through the use of KVPs. Any KVP consumer can get confused by the duplicate keys and a race condition can and have occurred. --- cloudinit/reporting/handlers.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'cloudinit') diff --git a/cloudinit/reporting/handlers.py b/cloudinit/reporting/handlers.py index 10165aec..6605e795 100755 --- a/cloudinit/reporting/handlers.py +++ b/cloudinit/reporting/handlers.py @@ -1,6 +1,7 @@ # This file is part of cloud-init. See LICENSE file for license information. import abc +import uuid import fcntl import json import six @@ -201,10 +202,11 @@ class HyperVKvpReportingHandler(ReportingHandler): def _event_key(self, event): """ the event key format is: - CLOUD_INIT||| + CLOUD_INIT||||