Improve 'type' for ComplexOptCheck and PresenceCheck classes
authorAlexander Popov <alex.popov@linux.com>
Mon, 14 Feb 2022 21:19:42 +0000 (00:19 +0300)
committerAlexander Popov <alex.popov@linux.com>
Mon, 14 Feb 2022 22:03:15 +0000 (01:03 +0300)
kconfig_hardened_check/__init__.py

index 5092742fcc4e5392fd01d38b3dc87faee30d0d91..7db4f5db98815a14e475a61fd7a40831ad897542 100644 (file)
@@ -159,7 +159,7 @@ class PresenceCheck:
         if self.type == 'kconfig':
             self.name = 'CONFIG_' + name
         else:
-            self.name = name
+            sys.exit('[!] ERROR: unsupported type "{}" for {}'.format(type, self.__class__.__name__))
         self.state = None
         self.result = None
 
@@ -193,7 +193,7 @@ class ComplexOptCheck:
 
     @property
     def type(self):
-        return self.opts[0].type
+        return 'complex'
 
     @property
     def expected(self):