Skip to content

Commit

Permalink
Handle changes in content identification
Browse files Browse the repository at this point in the history
The code is able to handle changes in the way how oscap identifies
content much more gracefully.
  • Loading branch information
matejak committed Oct 12, 2022
1 parent f6ce614 commit da29b64
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions org_fedora_oscap/content_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ def get_doc_type(file_path):
if line.startswith("Document type:"):
_prefix, _sep, type_info = line.partition(":")
content_type = type_info.strip()
if content_type not in CONTENT_TYPES.values():
log.info(
f"File {file_path} labelled by oscap as {content_type}, "
"which is an unexpected type.")
content_type = f"unknown - {content_type}"
break
except OSError:
# 'oscap info' exitted with a non-zero exit code -> unknown doc
Expand Down

0 comments on commit da29b64

Please sign in to comment.