From d9bf418f2a06d353fa076a2a21f904bbab66a27a Mon Sep 17 00:00:00 2001 From: Aidan Reilly <74046732+aireilly@users.noreply.github.com> Date: Wed, 1 May 2024 15:57:49 +0100 Subject: [PATCH] test --- build_for_portal.py | 19 +++++++++++-------- ...-collector-log-forward-sts-cloudwatch.adoc | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/build_for_portal.py b/build_for_portal.py index d4a2f5359098..005d38b0f1d2 100644 --- a/build_for_portal.py +++ b/build_for_portal.py @@ -23,7 +23,7 @@ cli.init_logging(False, True) -has_errors = False +list_of_errors = [] CLONE_DIR = "." BASE_PORTAL_URL = "https://access.redhat.com/documentation/en-us/" # ID_RE = re.compile("^\[(?:\[|id=\'|#)(.*?)(\'?,.*?)?(?:\]|\')?\]", re.M | re.DOTALL) @@ -442,6 +442,7 @@ def reformat_for_drupal(info): # Reformat the data for book in books: + log.info("Processing %s", book["Dir"]) book_src_dir = os.path.join(src_dir, book["Dir"]) @@ -460,6 +461,7 @@ def reformat_for_drupal(info): copy_images(book, src_dir, images_dir, distro) + def copy_images(node, src_path, dest_dir, distro): """ Copy images over to the destination directory and flatten all image directories into the one top level dir. @@ -630,7 +632,7 @@ def scrub_file(info, book_src_dir, src_file, tag=None, cwd=None): raise ConnectionError("Malformed URL") except Exception as exception: log.error("An include file wasn't found: %s", base_src_file) - has_errors = True + list_of_errors.append(f"An include file wasn't found: {base_src_file}") sys.exit(-1) # Get a list of predefined custom title ids for the file @@ -732,7 +734,6 @@ def fix_links(content, info, book_src_dir, src_file, tag=None, cwd=None): content = _fix_links( content, book_src_dir, src_file, info, tag=tag, cwd=cwd ) - return content def dir_to_book_name(dir,src_file,info): @@ -742,11 +743,11 @@ def dir_to_book_name(dir,src_file,info): return(book["Name"]) break - has_errors = True log.error( 'ERROR (%s): book not found for the directory %s', src_file, dir) + list_of_errors.append(f"ERROR ({src_file}): book not found for the directory {dir}") return(dir) @@ -791,6 +792,7 @@ def _fix_links(content, book_dir, src_file, info, tag=None, cwd=None): 'ERROR (%s): link pointing outside source directory? %s', src_file, link_file) + list_of_errors.append(f'ERROR ({src_file}): link pointing outside source directory? {link_file}') continue split_relative_path = full_relative_path.split("/") book_dir_name = split_relative_path[0] @@ -823,13 +825,14 @@ def _fix_links(content, book_dir, src_file, info, tag=None, cwd=None): fixed_link = link_text if EXTERNAL_LINK_RE.search(link_file) is not None: rel_src_file = src_file.replace(os.path.dirname(book_dir) + "/", "") - has_errors = True + link_text_message = link_text.replace("\n", "") log.error( 'ERROR (%s): "%s" appears to try to reference a file not included in the "%s" distro', rel_src_file, - link_text.replace("\n", ""), + link_text_message, info["distro"], ) + list_of_errors.append(f'ERROR ({rel_src_file})): {link_text_message} appears to try to reference a file not included in the {info["distro"]} distro') else: fixed_link = "xref:" + link_anchor.replace("#", "") + link_title @@ -1177,7 +1180,7 @@ def main(): # Copy the original data and reformat for drupal reformat_for_drupal(info) - if has_errors: + if list_of_errors: sys.exit(1) if args.push: @@ -1211,4 +1214,4 @@ def main(): if __name__ == "__main__": - main() + main() \ No newline at end of file diff --git a/modules/cluster-logging-collector-log-forward-sts-cloudwatch.adoc b/modules/cluster-logging-collector-log-forward-sts-cloudwatch.adoc index bbd9ddc0ce74..c0595f8c1f03 100644 --- a/modules/cluster-logging-collector-log-forward-sts-cloudwatch.adoc +++ b/modules/cluster-logging-collector-log-forward-sts-cloudwatch.adoc @@ -6,7 +6,7 @@ [id="cluster-logging-collector-log-forward-sts-cloudwatch_{context}"] = Forwarding logs to Amazon CloudWatch from STS enabled clusters -For clusters with AWS Security Token Service (STS) enabled, you can create an AWS service account manually or create a credentials request by using the Cloud Credential Operator (CCO) utility `ccoctl`. +For clusters with AWS Security Token Service (STS) enabled, you can create an AWS service account manually or create a credentials request by using the xref:../../authentication/managing_cloud_provider_credentials/about-cloud-credential-operator.adoc[Cloud Credential Operator (CCO)] utility `ccoctl`. .Prerequisites