Navigation Menu

Skip to content

Commit

Permalink
fix lazy vendor problem with uuid. rockstor#983
Browse files Browse the repository at this point in the history
  • Loading branch information
schakrava committed Jul 1, 2016
1 parent a376118 commit fb2fc12
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/rockstor/system/osi.py
Expand Up @@ -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()))

0 comments on commit fb2fc12

Please sign in to comment.