Commit 0b8e9770 by Alexander Popov

Introduce the ComplexOptCheck superclass

parent 646cc660
......@@ -68,16 +68,11 @@ class OptCheck:
return '{} = {}'.format(self.name, self.state)
class OR:
class ComplexOptCheck:
def __init__(self, *opts):
self.opts = opts
self.result = None
# self.opts[0] is the option which this OR-check is about.
# Use case:
# OR(<X_is_hardened>, <X_is_disabled>)
# OR(<X_is_hardened>, <X_is_hardened_old>)
@property
def name(self):
return self.opts[0].name
......@@ -98,6 +93,13 @@ class OR:
def reason(self):
return self.opts[0].reason
class OR(ComplexOptCheck):
# self.opts[0] is the option which this OR-check is about.
# Use case:
# OR(<X_is_hardened>, <X_is_disabled>)
# OR(<X_is_hardened>, <X_is_hardened_old>)
def check(self):
for i, opt in enumerate(self.opts):
result, msg = opt.check()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment