Fix style (quotation marks)
authorAlexander Popov <alex.popov@linux.com>
Sun, 1 Sep 2024 18:56:46 +0000 (21:56 +0300)
committerAlexander Popov <alex.popov@linux.com>
Sun, 1 Sep 2024 21:36:30 +0000 (00:36 +0300)
kernel_hardening_checker/engine.py

index 39f54c54c240c77576aab893e76c6c742e3e2690..0627adb4ef04b66d86ba82891c3fa3214d91be16 100755 (executable)
@@ -120,16 +120,16 @@ class OptCheck:
     def json_dump(self, with_results: bool) -> Dict[str, StrOrBool]:
         assert(self.opt_type), f'unexpected empty opt_type in {self.name}'
         dump = {
-            "option_name": self.name,
-            "type": self.opt_type,
-            "desired_val": self.expected,
-            "decision": self.decision,
-            "reason": self.reason,
+            'option_name': self.name,
+            'type': self.opt_type,
+            'desired_val': self.expected,
+            'decision': self.decision,
+            'reason': self.reason,
         } # type: Dict[str, StrOrBool]
         if with_results:
             assert(self.result), f'unexpected empty result in {self.name}'
-            dump["check_result"] = self.result
-            dump["check_result_bool"] = self.result.startswith('OK')
+            dump['check_result'] = self.result
+            dump['check_result_bool'] = self.result.startswith('OK')
         return dump
 
 
@@ -250,8 +250,8 @@ class ComplexOptCheck:
         if with_results:
             # Add the 'check_result' and 'check_result_bool' keys to the dictionary
             assert(self.result), f'unexpected empty result in {self.name}'
-            dump["check_result"] = self.result
-            dump["check_result_bool"] = self.result.startswith('OK')
+            dump['check_result'] = self.result
+            dump['check_result_bool'] = self.result.startswith('OK')
         return dump
 
 
@@ -392,7 +392,7 @@ def override_expected_value(checklist: List[ChecklistObjType], name: str, new_va
     for opt in checklist:
         if opt.name == name:
             assert(isinstance(opt, SimpleNamedOptCheckTypes)), \
-                   f'overriding an expected value for {opt}" is not supported yet'
+                   f'overriding an expected value for "{opt}" is not supported yet'
             opt.expected = new_val