From fb2fc12b90deaabd51bcee5277c2eabfd0f942cb Mon Sep 17 00:00:00 2001 From: Suman Chakravartula Date: Fri, 1 Jul 2016 16:35:42 -0700 Subject: [PATCH] fix lazy vendor problem with uuid. #983 --- src/rockstor/system/osi.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/rockstor/system/osi.py b/src/rockstor/system/osi.py index 30b177dae..ce1a1659e 100644 --- a/src/rockstor/system/osi.py +++ b/src/rockstor/system/osi.py @@ -1080,9 +1080,16 @@ def hostid(): """Get the system's uuid from /sys/class/dmi/id/product_uuid. If the file doesn't exist for any reason, generate a uuid like we used to prior to this change. + + There's a lazy vendor problem where uuid is not set and defaults to + 03000200-0400-0500-0006-000700080009. non-persistent uuid is generated even + in this case. """ try: with open("/sys/class/dmi/id/product_uuid") as fo: - return fo.readline().strip() + puuid = fo.readline().strip() + if (puuid == '03000200-0400-0500-0006-000700080009'): + raise + return puuid except: - return '%s-%s' % (run_command(HOSTID)[0][0], str(uuid.uuid4())) + return '%s-%s' % (run_command([HOSTID])[0][0], str(uuid.uuid4()))