Skip to content

Commit beedcb7

Browse files
authored
Merge pull request #2448 from DougAnsonAustinTX/updated-tools
minor fixes to tools
2 parents 33836f1 + 0d30e70 commit beedcb7

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

tools/maintenance.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
Test Learning Path
2323
"""
2424
def check_lp(lp_path, link, debug):
25+
test_image_results = None # initialize the variable
2526
if not os.path.isdir(lp_path):
2627
lp_path = os.path.dirname(lp_path)
2728

@@ -156,10 +157,13 @@ def main():
156157
if args.stats_report:
157158
# If all test results are zero, all tests have passed
158159
patch.patch(args.instructions, results_dict, args.link)
159-
if all(results_dict.get(k) for k in results_dict):
160-
# Errors exist
161-
logging.info("Tests failed in test suite")
162-
sys.exit(1)
160+
if results_dict is not None:
161+
if all(results_dict.get(k) for k in results_dict):
162+
# Errors exist
163+
logging.info("Tests failed in test suite")
164+
sys.exit(1)
165+
else:
166+
pass
163167
elif args.spelling:
164168
logging.info(f"Checking spelling of {args.spelling}")
165169
output = parse.spelling(args.spelling)

tools/patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def patch(article_path: str, results: dict, link: str):
1616
article_path_pure = PurePath(re.sub(r"^.*?content/", "", article_path))
1717
article_path_parts = list(article_path_pure.parts)
1818
if "learning-paths" in article_path_parts:
19-
content_type, sw_category, content_title = article_path_parts
19+
content_type, sw_category, content_title, *others = article_path_parts
2020
article_path = PurePath(article_path, "_index.md")
2121
elif "install-guides" in article_path_parts:
2222
# In case the install guide is in a subdirectory

0 commit comments

Comments
 (0)