]>
Commit | Line | Data |
---|---|---|
7e8b0ca0 MT |
1 | From 220ffe76a48c72171d7724f7f602a2fdd8bbca6a Mon Sep 17 00:00:00 2001 |
2 | From: Michael Tremer <michael.tremer@ipfire.org> | |
3 | Date: Sat, 15 Feb 2014 18:37:54 +0100 | |
4 | Subject: [PATCH] Exclude some more invalid patterns. | |
5 | ||
6 | --- | |
7 | src/fireinfo/system.py | 15 +++++++++++++-- | |
8 | 1 file changed, 13 insertions(+), 2 deletions(-) | |
9 | ||
10 | diff --git a/src/fireinfo/system.py b/src/fireinfo/system.py | |
11 | index 40ff7b0..c875f96 100644 | |
12 | --- a/src/fireinfo/system.py | |
13 | +++ b/src/fireinfo/system.py | |
14 | @@ -44,12 +44,17 @@ INVALID_ID_STRINGS = ( | |
15 | "Chassis", "chassis", | |
16 | "Not Applicable", | |
17 | "None", "empty", | |
18 | + "XXXXX", | |
19 | "01010101-0101-0101-0101-010101010101", | |
20 | "00020003-0004-0005-0006-000700080009", | |
21 | "03000200-0400-0500-0006-000700080009", | |
22 | "0000000", "00000000", | |
23 | ) | |
24 | ||
25 | +INVALID_ID_STRINGS_EXACT_MATCH = ( | |
26 | + "NA", | |
27 | +) | |
28 | + | |
29 | class Singleton(type): | |
30 | def __init__(cls, name, bases, dict): | |
31 | super(Singleton, cls).__init__(name, bases, dict) | |
32 | @@ -234,12 +239,18 @@ class System(object): | |
33 | if id is None: | |
34 | continue | |
35 | ||
36 | - for i in INVALID_ID_STRINGS: | |
37 | - if i in id: | |
38 | + for i in INVALID_ID_STRINGS_EXACT_MATCH: | |
39 | + if id == i: | |
40 | id = None | |
41 | break | |
42 | ||
43 | if id: | |
44 | + for i in INVALID_ID_STRINGS: | |
45 | + if i in id: | |
46 | + id = None | |
47 | + break | |
48 | + | |
49 | + if id: | |
50 | _ids.append(id) | |
51 | ||
52 | ids = _ids | |
53 | -- | |
54 | 1.8.3.1 | |
55 |