diff --git a/irrd/scripts/irr_rpsl_submit.py b/irrd/scripts/irr_rpsl_submit.py index 298326433..bee192ca7 100755 --- a/irrd/scripts/irr_rpsl_submit.py +++ b/irrd/scripts/irr_rpsl_submit.py @@ -639,7 +639,8 @@ def format_as_text(response): Format an IRRd HTTP response into a human-friendly text. """ summary = response["summary"] - user_report = textwrap.dedent(f""" + user_report = textwrap.dedent( + f""" SUMMARY OF UPDATE: Number of objects found: {summary["objects_found"]:3} @@ -655,7 +656,8 @@ def format_as_text(response): DETAILED EXPLANATION: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - """) + """ + ) for object_result in response["objects"]: user_report += "---\n" user_report += format_report_object(object_result) @@ -722,7 +724,8 @@ def process_args(options): # output something. if "--help" in options: raise XHelp("") from error - raise XArgumentError("Error processing command-line arguments: {error.message}") from error + message = error.message if hasattr(error, "message") else "" + raise XArgumentError(f"Error processing command-line arguments: {message}") from error if args.debug: logger.setLevel(logging.DEBUG) @@ -770,7 +773,8 @@ def metadata(metadata_values): except IndexError as error: raise ValueError() from error - description = textwrap.dedent("""\ + description = textwrap.dedent( + """\ Read RPSL submissions from stdin and return a response on stdout. Errors or debug info are printed to stderr. This program accepts the arguments for irrdv3's version of irr_rpsl_submit but ignores @@ -797,7 +801,8 @@ def metadata(metadata_values): 16 - unexpected response 32 - an unidentified error - """) + """ + ) parser = argparse.ArgumentParser( add_help=False,