Skip to content

Commit 7dbd76d

Browse files
committed
Fix pep8speaks issues
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]>
1 parent d25d2b5 commit 7dbd76d

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

build-scripts/verify_references.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,10 @@ def main():
215215
if check_system == sce_cs:
216216
check_path = os.path.join(options.base_dir, check_content_ref_href_attr)
217217
if not os.path.exists(check_path):
218-
print("ERROR: Invalid or missing SCE definition (%s) referenced by XCCDF Rule: %s"
219-
% (check_path, rule.get("id")))
218+
msg = "ERROR: Invalid or missing SCE definition (%s) "
219+
msg += "referenced by XCCDF Rule: %s"
220+
msg = msg % (check_path, rule.get("id"))
221+
print(msg)
220222
exit_value = 1
221223
else:
222224
refname = check_content_ref.get("name")

ssg/build_profile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def get_profile_stats(self, profile):
197197
oval = rule.find("./{%s}check[@system=\"%s\"]" %
198198
(xccdf_ns, oval_ns))
199199
sce = rule.find("./{%s}check[@system=\"%s\"]" %
200-
(xccdf_ns, sce_ns))
200+
(xccdf_ns, sce_ns))
201201
bash_fix = rule.find("./{%s}fix[@system=\"%s\"]" %
202202
(xccdf_ns, bash_rem_system))
203203
ansible_fix = rule.find("./{%s}fix[@system=\"%s\"]" %

ssg/build_sce.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from .rules import get_rule_dir_id, get_rule_dir_sces, find_rule_dirs_in_paths
1414
from . import utils
1515

16+
1617
def load_sce_and_metadata(file_path, local_env_yaml):
1718
raw_content = process_file_with_macros(file_path, local_env_yaml)
1819

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

100101
local_env_yaml['rule_id'] = rule.id_
101102
local_env_yaml['rule_title'] = rule.title
102-
local_env_yaml['products'] = prodtypes # default is all
103+
local_env_yaml['products'] = prodtypes # default is all
103104

104105
for _path in get_rule_dir_sces(_dir_path, product):
105106
# To be compatible with later checks, use the rule_id (i.e., the

ssg/build_yaml.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1447,7 +1447,8 @@ def to_xml_element(self):
14471447
check_export.set('export-name', export)
14481448

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

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

15851586

15861587
class BuildLoader(DirectoryLoader):
1587-
def __init__(self, profiles_dir, bash_remediation_fns, env_yaml, resolved_rules_dir=None, sce_metadata_path=None):
1588+
def __init__(self, profiles_dir, bash_remediation_fns, env_yaml,
1589+
resolved_rules_dir=None, sce_metadata_path=None):
15881590
super(BuildLoader, self).__init__(profiles_dir, bash_remediation_fns, env_yaml)
15891591

15901592
self.resolved_rules_dir = resolved_rules_dir

0 commit comments

Comments
 (0)