Skip to content

Commit 1631fd5

Browse files
compsmatusmarhefka
authored andcommitted
fix reversed logic in Datastream.has_remediation
Signed-off-by: Jiri Jaburek <[email protected]>
1 parent f53ff7b commit 1631fd5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/oscap.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ def parse_xml(self, xml_file):
125125
self.rules[for_rule].fixes |= fix_type
126126
stack.pop()
127127

128-
def has_no_remediation(self, rule):
128+
def has_remediation(self, rule):
129129
"""
130-
Return True if 'rule' has no bash remediation, False otherwise.
130+
Return True if 'rule' has bash remediation, False otherwise.
131131
"""
132132
if rule not in self.rules:
133133
return False
134134
# TODO: come up with a different way of handling "no remediation" cases,
135135
# retain the current "has no *bash* remediation" behavior for now
136-
return self.rules[rule].fixes & self.FixType.bash
136+
return bool(self.rules[rule].fixes & self.FixType.bash)
137137

138138
def get_all_profiles_rules(self):
139139
"""
@@ -198,7 +198,7 @@ def report_from_verbose(lines):
198198
if status in ['pass', 'error']:
199199
pass
200200
elif status == 'fail':
201-
if global_ds().has_no_remediation(rule):
201+
if not global_ds().has_remediation(rule):
202202
note = 'no remediation'
203203
status = 'warn'
204204
elif status in ['notapplicable', 'notchecked', 'notselected', 'informational']:

0 commit comments

Comments
 (0)