projects
/
kconfig-hardened-check.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
76ad3f2
)
Revisit special behavior in checking and printing that depends on the class
author
Alexander Popov
<alex.popov@linux.com>
Tue, 31 Mar 2020 12:24:13 +0000
(15:24 +0300)
committer
Alexander Popov
<alex.popov@linux.com>
Tue, 31 Mar 2020 12:24:13 +0000
(15:24 +0300)
kconfig_hardened_check/__init__.py
patch
|
blob
|
history
diff --git
a/kconfig_hardened_check/__init__.py
b/kconfig_hardened_check/__init__.py
index 8e224c9164baa2b2025988c64aae5d6bb8062009..48e545445b8af1a597da7df2ef1549d0e4fb8755 100755
(executable)
--- a/
kconfig_hardened_check/__init__.py
+++ b/
kconfig_hardened_check/__init__.py
@@
-158,7
+158,7
@@
class OR(ComplexOptCheck):
for i, opt in enumerate(self.opts):
ret, msg = opt.check()
if ret:
for i, opt in enumerate(self.opts):
ret, msg = opt.check()
if ret:
- if i == 0 or not hasattr(opt, '
name
'):
+ if i == 0 or not hasattr(opt, '
expected
'):
self.result = opt.result
else:
self.result = 'OK: CONFIG_{} "{}"'.format(opt.name, opt.expected)
self.result = opt.result
else:
self.result = 'OK: CONFIG_{} "{}"'.format(opt.name, opt.expected)
@@
-179,7
+179,7
@@
class AND(ComplexOptCheck):
self.result = opt.result
return ret, self.result
elif not ret:
self.result = opt.result
return ret, self.result
elif not ret:
- if hasattr(opt, '
name
'):
+ if hasattr(opt, '
expected
'):
self.result = 'FAIL: CONFIG_{} is needed'.format(opt.name)
else:
self.result = opt.result
self.result = 'FAIL: CONFIG_{} is needed'.format(opt.name)
else:
self.result = opt.result
@@
-515,12
+515,12
@@
def perform_checks(checklist, parsed_options):
if hasattr(opt, 'opts'):
# prepare ComplexOptCheck
for o in opt.opts:
if hasattr(opt, 'opts'):
# prepare ComplexOptCheck
for o in opt.opts:
- if hasattr(o, '
nam
e'):
+ if hasattr(o, '
stat
e'):
o.state = parsed_options.get(o.name, None)
else:
o.state = parsed_options.get(o.name, None)
else:
- # prepare simple
OptC
heck
- if not hasattr(opt, '
nam
e'):
- sys.exit('[!] ERROR: bad
OptC
heck {}'.format(vars(opt)))
+ # prepare simple
c
heck
+ if not hasattr(opt, '
stat
e'):
+ sys.exit('[!] ERROR: bad
simple c
heck {}'.format(vars(opt)))
opt.state = parsed_options.get(opt.name, None)
opt.check()
opt.state = parsed_options.get(opt.name, None)
opt.check()