]> git.ipfire.org Git - oddments/fireinfo.git/commitdiff
Exclude some more invalid patterns.
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 15 Feb 2014 17:37:54 +0000 (18:37 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 15 Feb 2014 17:37:54 +0000 (18:37 +0100)
src/fireinfo/system.py

index 40ff7b08172cad61541fff45095bb4080c3aeb79..c875f96f1b6b6e5cda07fe414c0ede62c045ba0d 100644 (file)
@@ -44,12 +44,17 @@ INVALID_ID_STRINGS = (
        "Chassis", "chassis",
        "Not Applicable",
        "None", "empty",
+       "XXXXX",
        "01010101-0101-0101-0101-010101010101",
        "00020003-0004-0005-0006-000700080009",
        "03000200-0400-0500-0006-000700080009",
        "0000000", "00000000",
 )
 
+INVALID_ID_STRINGS_EXACT_MATCH = (
+       "NA",
+)
+
 class Singleton(type):
        def __init__(cls, name, bases, dict):
                super(Singleton, cls).__init__(name, bases, dict)
@@ -234,11 +239,17 @@ class System(object):
                        if id is None:
                                continue
 
-                       for i in INVALID_ID_STRINGS:
-                               if i in id:
+                       for i in INVALID_ID_STRINGS_EXACT_MATCH:
+                               if id == i:
                                        id = None
                                        break
 
+                       if id:
+                               for i in INVALID_ID_STRINGS:
+                                       if i in id:
+                                               id = None
+                                               break
+
                        if id:
                                _ids.append(id)