diff --git a/irrd/scripts/irr_rpsl_submit.py b/irrd/scripts/irr_rpsl_submit.py index 9ddbeeb..2983264 100755 --- a/irrd/scripts/irr_rpsl_submit.py +++ b/irrd/scripts/irr_rpsl_submit.py @@ -221,21 +221,6 @@ def prefix(self): return "Connection refused" # pragma: no cover -class XHTTPNotFound(XNetwork): - """ - Raised when the response returns 404. - - This is a refinement of HTTPError, which is not granular enough - to provide useful information to consumers. - """ - - def prefix(self): - """ - Returns the prefix to attach to the start of each logged message. - """ - return "Not found" - - class XNameResolutionFailed(XNetwork): """ Raised when urllib cannot resolve the URL host. @@ -763,8 +748,6 @@ def send_request(requests_text, args): raise XNameResolutionFailed(args.url, reason) from error if isinstance(reason, (socket.timeout, ConnectionRefusedError)): raise XHTTPConnectionFailed(args.url, http_request) from error # pragma: no cover - if reason == "Not Found": - raise XHTTPNotFound(args.url, http_request) from error raise error # pragma: no cover: CI glitch workaround except Exception as error: raise error diff --git a/irrd/scripts/tests/test_irr_rpsl_submit.py b/irrd/scripts/tests/test_irr_rpsl_submit.py index 20bd2f2..dce1d91 100755 --- a/irrd/scripts/tests/test_irr_rpsl_submit.py +++ b/irrd/scripts/tests/test_irr_rpsl_submit.py @@ -37,7 +37,7 @@ REGEX_UNRESOLVABLE = re.compile("Could not resolve") REGEX_UNREACHABLE = re.compile("Connection refused|Cannot assign requested address") REGEX_BAD_RESPONSE = re.compile("decoding JSON") -REGEX_NOT_FOUND = re.compile("Not found") +REGEX_NOT_ALLOWED = re.compile("Method Not Allowed") EXIT_SUCCESS = 0 EXIT_CHANGE_FAILED = 1 @@ -767,7 +767,7 @@ def test_020_dash_o_noop(self): EXIT_NETWORK_ERROR, "using both -h and -O exits with value appropriate to -h value", ) - self.assertRegex(result.stderr, REGEX_NOT_FOUND) + self.assertRegex(result.stderr, REGEX_NOT_ALLOWED) def test_030_empty_input_option(self): result = Runner.run(["-u", IRRD_URL], ENV_EMPTY, RPSL_EMPTY) @@ -841,7 +841,7 @@ def test_050_non_json_response(self): result = Runner.run(row, ENV_EMPTY, RPSL_MINIMAL) self.assertEqual( result.returncode, - EXIT_RESPONSE_ERROR, + EXIT_NETWORK_ERROR, f"Bad response URL {row[1]} exits with {EXIT_NETWORK_ERROR}", ) - self.assertRegex(result.stderr, REGEX_BAD_RESPONSE) + self.assertRegex(result.stderr, REGEX_NOT_ALLOWED)