MCPcopy Create free account
hub / github.com/ceph/ceph / validate_port

Function validate_port

src/python-common/ceph/deployment/utils.py:181–185  ·  view source on GitHub ↗
(port: Optional[int], field_name: str = 'port')

Source from the content-addressed store, hash-verified

179
180
181def validate_port(port: Optional[int], field_name: str = 'port') -> None:
182 if port is not None and not (1 <= port <= 65535):
183 raise SpecValidationError(
184 f'Invalid {field_name}: {port}. Must be between 1 and 65535.'
185 )
186
187
188def validate_unique_ports(ports: List[int]) -> None:

Callers 2

validateMethod · 0.90
validateMethod · 0.90

Calls 1

SpecValidationErrorClass · 0.90

Tested by

no test coverage detected