From 3801e4d97de319e1d3843082e5b0b624741ff0d8 Mon Sep 17 00:00:00 2001 From: Matej Tyc Date: Wed, 12 Oct 2022 11:38:51 +0200 Subject: [PATCH] Remove unused code The function is not referenced anywhere in the project --- org_fedora_oscap/content_handling.py | 40 ---------------------------- 1 file changed, 40 deletions(-) diff --git a/org_fedora_oscap/content_handling.py b/org_fedora_oscap/content_handling.py index 3e2ecaed..5096bab1 100644 --- a/org_fedora_oscap/content_handling.py +++ b/org_fedora_oscap/content_handling.py @@ -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