Skip to content

Commit

Permalink
Avoid too many return statements in a function
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-cerny committed Jan 11, 2023
1 parent f3ace31 commit ac6a0f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ssg/build_ovals.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,6 @@ def get_checks_from_benchmark(


def _process_oval_file(filename, oval_dir, already_loaded, env_yaml):
if not filename.endswith(".xml"):
return None
oval_file_path = os.path.join(oval_dir, filename)
if "checks_from_templates" in oval_dir:
with open(oval_file_path, "r") as f:
Expand All @@ -384,6 +382,8 @@ def _process_directory(oval_dir, env_yaml, already_loaded):
oval_version = utils.required_key(env_yaml, "target_oval_version_str")
# sort the files to make output deterministic
for filename in sorted(os.listdir(oval_dir)):
if not filename.endswith(".xml"):
continue
xml_content = _process_oval_file(
filename, oval_dir, already_loaded, env_yaml)
if not xml_content:
Expand Down

0 comments on commit ac6a0f4

Please sign in to comment.