From: Michael Tremer Date: Sat, 11 Dec 2010 19:15:27 +0000 (+0100) Subject: Only use disk string if no other was found. X-Git-Tag: v0.9~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=121f9f20fbe26ab91dd8ec7a3fbb62e2c64a9357;p=oddments%2Ffireinfo.git Only use disk string if no other was found. --- diff --git a/fireinfo/system.py b/fireinfo/system.py index 21a7496..72a4fbc 100644 --- a/fireinfo/system.py +++ b/fireinfo/system.py @@ -190,11 +190,6 @@ class System(object): id = read_from_file(os.path.join(SYS_CLASS_DMI, file)) ids.append(id) - # Use serial number from root disk (if available) - root_disk_serial = self.root_disk_serial - if root_disk_serial: - ids.append(root_disk_serial) - # Sort out all bogous or invalid strings from the list. _ids = [] for id in ids: @@ -211,6 +206,11 @@ class System(object): ids = _ids + # Use serial number from root disk (if available) + root_disk_serial = self.root_disk_serial + if root_disk_serial: + ids.append(root_disk_serial) + # As last resort, we use the UUID from pakfire. if not ids: id = read_from_file("/opt/pakfire/db/uuid")