]> git.ipfire.org Git - oddments/fireinfo.git/commitdiff
Concatenate several informations and build a new ID out of it.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 2 Dec 2010 20:45:28 +0000 (21:45 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 2 Dec 2010 20:45:28 +0000 (21:45 +0100)
fireinfo/system.py

index 9ee82c5092a3911db43bb870e643cf338407be3b..bf2fb433276711f75fda9801fae8cc2fdf8f4e27 100644 (file)
@@ -115,6 +115,9 @@ class System(object):
                        "public_id" : self.public_id,
                        "private_id" : self.private_id,
 
+                       # XXX just for testing:
+                       "secret_id" : self._unique_id,
+
                        # Actual profile data
                        "profile" : p,
                }
@@ -161,21 +164,20 @@ class System(object):
 
                        None of the data here is ever sent to the server.
                """
-               id = ""
+               ids = []
 
                # Virtual machines (for example) and some boards have a UUID
                # which is globally unique.
                for file in ("product_uuid", "product_serial", "chassis_serial"):
-                       id = read_from_file(os.path.join(SYS_CLASS_DMI, file))
-                       if id:
-                               return id
+                       id = read_from_file(os.path.join(SYS_CLASS_DMI, file)) or ""
+                       ids.append(id)
 
                # As last resort, we use the UUID from pakfire.
-               id = read_from_file("/opt/pakfire/db/uuid")
-               if id:
-                       return id
+               if not ids:
+                       id = read_from_file("/opt/pakfire/db/uuid") or ""
+                       ids.append(id)
 
-               return ""
+               return "#".join(ids)
 
        @property
        def language(self):