Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
The function is not referenced anywhere in the project
  • Loading branch information
matejak committed Oct 12, 2022
1 parent 81c4c03 commit 3801e4d
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions org_fedora_oscap/content_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,43 +141,3 @@ def get_doc_type(file_path):
log.info("OSCAP addon: Identified {file_path} as {content_type}"
.format(file_path=file_path, content_type=content_type))
return content_type


def explore_content_files(fpaths):
"""
Function for finding content files in a list of file paths. SIMPLY PICKS
THE FIRST USABLE CONTENT FILE OF A PARTICULAR TYPE AND JUST PREFERS DATA
STREAMS OVER STANDALONE BENCHMARKS.
:param fpaths: a list of file paths to search for content files in
:type fpaths: [str]
:return: ContentFiles instance containing the file names of the XCCDF file,
CPE dictionary and tailoring file or "" in place of those items
if not found
:rtype: ContentFiles
"""
xccdf_file = ""
cpe_file = ""
tailoring_file = ""
found_ds = False

for fpath in fpaths:
doc_type = get_doc_type(fpath)
if not doc_type:
continue

# prefer DS over standalone XCCDF
if doc_type == "Source Data Stream" and (not xccdf_file or not found_ds):
xccdf_file = fpath
found_ds = True
elif doc_type == "XCCDF Checklist" and not xccdf_file:
xccdf_file = fpath
elif doc_type == "CPE Dictionary" and not cpe_file:
cpe_file = fpath
elif doc_type == "XCCDF Tailoring" and not tailoring_file:
tailoring_file = fpath

# TODO: raise exception if no xccdf_file is found?
files = ContentFiles(xccdf_file, cpe_file, tailoring_file)
return files

0 comments on commit 3801e4d

Please sign in to comment.