projects
/
kconfig-hardened-check.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make the table column names and JSON field names fit each other
[kconfig-hardened-check.git]
/
kernel_hardening_checker
/
engine.py
diff --git
a/kernel_hardening_checker/engine.py
b/kernel_hardening_checker/engine.py
index 268a142387b87940d1803adbb2fe72b6d6c71a24..519070857abb92667e85e09b199b17002d2afaaf 100644
(file)
--- a/
kernel_hardening_checker/engine.py
+++ b/
kernel_hardening_checker/engine.py
@@
-104,9
+104,16
@@
class OptCheck:
print(f'| {colorize_result(self.result)}', end='')
def json_dump(self, with_results):
print(f'| {colorize_result(self.result)}', end='')
def json_dump(self, with_results):
- dump = [self.name, self.type, self.expected, self.decision, self.reason]
+ dump = {
+ "option_name": self.name,
+ "type": self.type,
+ "desired_val": self.expected,
+ "decision": self.decision,
+ "reason": self.reason,
+ }
if with_results:
if with_results:
- dump.append(self.result)
+ dump["check_result"] = self.result
+ dump["check_result_bool"] = self.result.startswith('OK')
return dump
return dump
@@
-219,7
+226,9
@@
class ComplexOptCheck:
def json_dump(self, with_results):
dump = self.opts[0].json_dump(False)
if with_results:
def json_dump(self, with_results):
dump = self.opts[0].json_dump(False)
if with_results:
- dump.append(self.result)
+ # Add the 'check_result' and 'check_result_bool' keys to the dictionary
+ dump["check_result"] = self.result
+ dump["check_result_bool"] = self.result.startswith('OK')
return dump
return dump