Skip to content

Commit

Permalink
Python bindings fixes
Browse files Browse the repository at this point in the history
We should not assume that all referenced files are OVAL files
Getting item values from a complex check wasn't extending the resulting list
  • Loading branch information
Martin Preisler authored and pvrabec committed Jan 20, 2012
1 parent 185426c commit ef2fdcc
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions swig/openscap_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def get_values_by_rule_id(self, id, check=None):
if check.complex:
# This check is complext so there is more checks within
for child in check.children:
self.get_values_by_rule_id(id, check=child)
values.extend(self.get_values_by_rule_id(id, check=child))
else:
for export in check.exports:
values.append(export.value)
Expand Down Expand Up @@ -656,8 +656,6 @@ def policy_export(self, result=None, title=None, filename=None, prefix=None, pat
result.title = o_title

dirname = os.path.dirname(filename)
if len(sessions.keys()) == 0:
raise IOError("Export failed: Corrupted session list or no OVAL file loaded")

OSCAP.xccdf_result_fill_sysinfo(result.instance)
files = [filename]
Expand Down

0 comments on commit ef2fdcc

Please sign in to comment.