Skip to content

Commit 54290c5

Browse files
committed
Set UUID also for IP records
IP records are a special case, since we only rely on counting IPs, but in order to be consistent with other records, we should have UUIDs for them.
1 parent e482b4b commit 54290c5

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

caso/extract/openstack/neutron.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import collections
2020
import ipaddress
21+
import uuid
2122

2223
from oslo_config import cfg
2324
from oslo_log import log
@@ -49,6 +50,7 @@ def _build_ip_record(self, user_id, ip_count, version):
4950
measure_time = self._get_measure_time()
5051

5152
r = record.IPRecord(
53+
uuid=uuid.uuid4().hex,
5254
measure_time=measure_time,
5355
site_name=CONF.site_name,
5456
user_id=user_id,

caso/record.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ class IPRecord(_BaseRecord):
157157

158158
version = "0.2"
159159

160+
uuid: m_uuid.UUID
161+
160162
user_id: typing.Optional[str]
161163
user_dn: typing.Optional[str]
162164
group_id: str

0 commit comments

Comments
 (0)