Skip to content

Commit

Permalink
print the original datastream.xml path in unselect_rules
Browse files Browse the repository at this point in the history
This is useful when trying to figure out where the datastream
came from, eg. whether CONTEST_CONTENT works.

Signed-off-by: Jiri Jaburek <[email protected]>
  • Loading branch information
comps authored and mildas committed Apr 9, 2024
1 parent 81fd45a commit dd54b6e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/oscap.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,13 @@ def unselect_rules(orig_ds, new_ds, rules):
if new_ds.exists():
new_ds.unlink()

util.log(f"reading {orig_ds}, writing to {new_ds}")
with open(orig_ds) as orig_ds_f:
with open(new_ds, 'w') as new_ds_f:
for line in orig_ds_f:
if any(x.search(line) for x in exprs):
line = line.replace('selected="true"', 'selected="false"')
util.log(f'unselected {line.strip()}')
util.log(f"unselected {line.strip()}")
new_ds_f.write(line)


Expand Down

0 comments on commit dd54b6e

Please sign in to comment.