]> git.ipfire.org Git - oddments/fireinfo.git/commitdiff
Only use disk string if no other was found.
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 11 Dec 2010 19:15:27 +0000 (20:15 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 11 Dec 2010 19:15:27 +0000 (20:15 +0100)
fireinfo/system.py

index 21a7496e992be4a4f9350b5ff55f4f9ac9e56362..72a4fbce82be4b98e6bb7e878b7ed21ecd59e5aa 100644 (file)
@@ -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")