Revert "autojson.py: Check the sensor name"
This reverts commit 086f19d287fdc7d7be9c52ad9aee7704e4f339f5.
The recent script change causes errors.
formatting file configurations/1Ux16 Riser.json
Traceback (most recent call last):
File "/build/openbmcup/build/workspace/sources/entity-manager/scripts/autojson.py", line 30, in <module>
nl = [s['Name'] for s in j['Exposes']]
TypeError: list indices must be integers or slices, not str
Considering the files this fail on have been around for a while, it's
clear they were never tested.
Change-Id: Ibda22e9ce43d1ba8e7a3c02609ef4d135ebb3044
diff --git a/scripts/autojson.py b/scripts/autojson.py
index 4a5fc5c..1a499df 100755
--- a/scripts/autojson.py
+++ b/scripts/autojson.py
@@ -27,13 +27,5 @@
else:
j["Exposes"] = sorted(j["Exposes"], key=lambda k: k["Type"])
- nl = [s['Name'] for s in j['Exposes']]
- ns = set(nl)
- for n in ns:
- t = nl.count(n)
- if t != 1:
- print('\033[1;35mthe %s appears %d times\033[0m!'%(n, t))
- os._exit(-1)
-
with open(file, 'w') as f:
f.write(json.dumps(j, indent=4, sort_keys=True, separators=(',', ': ')))