diff --git a/nova/api/validation/parameter_types.py b/nova/api/validation/parameter_types.py index 2bb58696ee..29253aa583 100644 --- a/nova/api/validation/parameter_types.py +++ b/nova/api/validation/parameter_types.py @@ -341,15 +341,6 @@ description = { 'maxLength': 255, } -# TODO(stephenfin): This is no longer used and should be removed -tcp_udp_port = { - 'type': ['integer', 'string'], - 'pattern': '^[0-9]*$', - 'minimum': 0, - 'maximum': 65535, - 'minLength': 1, -} - project_id = { 'type': 'string', 'pattern': '^[a-zA-Z0-9-]*$', diff --git a/nova/tests/unit/test_api_validation.py b/nova/tests/unit/test_api_validation.py index 357e9bb5e2..badd4b1fdd 100644 --- a/nova/tests/unit/test_api_validation.py +++ b/nova/tests/unit/test_api_validation.py @@ -764,31 +764,6 @@ class NameOrNoneTestCase(APIValidationTestCase): expected_detail=detail) -class TcpUdpPortTestCase(APIValidationTestCase): - - post_schema = { - 'type': 'object', - 'properties': { - 'foo': parameter_types.tcp_udp_port, - }, - } - - def test_validate_tcp_udp_port(self): - self.post(body={'foo': 1024}, req=FakeRequest()) - self.post(body={'foo': '1024'}, req=FakeRequest()) - - def test_validate_tcp_udp_port_fails(self): - detail = ("Invalid input for field/attribute foo. Value: True." - " True is not of type 'integer', 'string'") - self.check_validation_error(self.post, body={'foo': True}, - expected_detail=detail) - - detail = ("Invalid input for field/attribute foo. Value: 65536." - " 65536 is greater than the maximum of 65535") - self.check_validation_error(self.post, body={'foo': 65536}, - expected_detail=detail) - - class CidrFormatTestCase(APIValidationTestCase): post_schema = {