Skip to content

Commit

Permalink
Fix pep8speaks issues
Browse files Browse the repository at this point in the history
Note: pep8speaks also identified these issues:

    In the file build-scripts/profile_tool.py:

    Line 48:25: E128 continuation line under-indented for visual indent
    Line 49:25: E128 continuation line under-indented for visual indent
    Line 72:25: E128 continuation line under-indented for visual indent
    Line 73:25: E128 continuation line under-indented for visual indent

However, this indentation is consistent with the rest of the method so
I'm leaving them as-is.

Signed-off-by: Alexander Scheel <[email protected]>
  • Loading branch information
cipherboy committed Jul 29, 2021
1 parent d25d2b5 commit 7dbd76d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
6 changes: 4 additions & 2 deletions build-scripts/verify_references.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,10 @@ def main():
if check_system == sce_cs:
check_path = os.path.join(options.base_dir, check_content_ref_href_attr)
if not os.path.exists(check_path):
print("ERROR: Invalid or missing SCE definition (%s) referenced by XCCDF Rule: %s"
% (check_path, rule.get("id")))
msg = "ERROR: Invalid or missing SCE definition (%s) "
msg += "referenced by XCCDF Rule: %s"
msg = msg % (check_path, rule.get("id"))
print(msg)
exit_value = 1
else:
refname = check_content_ref.get("name")
Expand Down
2 changes: 1 addition & 1 deletion ssg/build_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def get_profile_stats(self, profile):
oval = rule.find("./{%s}check[@system=\"%s\"]" %
(xccdf_ns, oval_ns))
sce = rule.find("./{%s}check[@system=\"%s\"]" %
(xccdf_ns, sce_ns))
(xccdf_ns, sce_ns))
bash_fix = rule.find("./{%s}fix[@system=\"%s\"]" %
(xccdf_ns, bash_rem_system))
ansible_fix = rule.find("./{%s}fix[@system=\"%s\"]" %
Expand Down
3 changes: 2 additions & 1 deletion ssg/build_sce.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from .rules import get_rule_dir_id, get_rule_dir_sces, find_rule_dirs_in_paths
from . import utils


def load_sce_and_metadata(file_path, local_env_yaml):
raw_content = process_file_with_macros(file_path, local_env_yaml)

Expand Down Expand Up @@ -99,7 +100,7 @@ def checks(env_yaml, yaml_path, sce_dirs, output):

local_env_yaml['rule_id'] = rule.id_
local_env_yaml['rule_title'] = rule.title
local_env_yaml['products'] = prodtypes # default is all
local_env_yaml['products'] = prodtypes # default is all

for _path in get_rule_dir_sces(_dir_path, product):
# To be compatible with later checks, use the rule_id (i.e., the
Expand Down
6 changes: 4 additions & 2 deletions ssg/build_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,8 @@ def to_xml_element(self):
check_export.set('export-name', export)

check_ref = ET.SubElement(check, "check-content-ref")
check_ref.set("href", self.current_product + "/checks/sce/" + self.sce_metadata['filename'])
href = self.current_product + "/checks/sce/" + self.sce_metadata['filename']
check_ref.set("href", href)

if self.ocil or self.ocil_clause:
ocil = add_sub_element(rule, 'ocil', self.ocil if self.ocil else "")
Expand Down Expand Up @@ -1584,7 +1585,8 @@ def _process_rules(self):


class BuildLoader(DirectoryLoader):
def __init__(self, profiles_dir, bash_remediation_fns, env_yaml, resolved_rules_dir=None, sce_metadata_path=None):
def __init__(self, profiles_dir, bash_remediation_fns, env_yaml,
resolved_rules_dir=None, sce_metadata_path=None):
super(BuildLoader, self).__init__(profiles_dir, bash_remediation_fns, env_yaml)

self.resolved_rules_dir = resolved_rules_dir
Expand Down

0 comments on commit 7dbd76d

Please sign in to comment.