2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-01-11 18:42:29 +00:00

Fallback to mac

Some systems do not have UUIDs. Which is unfortunate, but usually
a system mac address does well enough.
This commit is contained in:
Jarrod Johnson
2025-04-11 08:38:51 -04:00
parent ddf9244514
commit 9174ad651f

View File

@@ -91,8 +91,11 @@ def scan_confluents():
confluentuuid = line.split(': ')[1]
msg += '/confluentuuid=' + confluentuuid
break
with open('/sys/devices/virtual/dmi/id/product_uuid') as uuidin:
msg += '/uuid=' + uuidin.read().strip()
try:
with open('/sys/devices/virtual/dmi/id/product_uuid') as uuidin:
msg += '/uuid=' + uuidin.read().strip()
except Exception:
pass
for addrf in glob.glob('/sys/class/net/*/address'):
with open(addrf) as addrin:
hwaddr = addrin.read().strip()