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

Function validate_unique_ports

src/python-common/ceph/deployment/utils.py:188–193  ·  view source on GitHub ↗

Raise SpecValidationError if any port is used more than once

(ports: List[int])

Source from the content-addressed store, hash-verified

186
187
188def validate_unique_ports(ports: List[int]) -> None:
189 """Raise SpecValidationError if any port is used more than once"""
190 if len(ports) != len(set(ports)):
191 raise SpecValidationError(
192 'Invalid port: Duplicate ports are not allowed'
193 )

Callers 1

validateMethod · 0.90

Calls 2

SpecValidationErrorClass · 0.90
setFunction · 0.50

Tested by

no test coverage detected