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

Function verify_non_negative_int

src/python-common/ceph/deployment/utils.py:139–144  ·  view source on GitHub ↗
(field: Any, field_name: str)

Source from the content-addressed store, hash-verified

137
138
139def verify_non_negative_int(field: Any, field_name: str) -> None:
140 verify_numeric(field, field_name)
141 if field is not None:
142 verify_int(field, field_name)
143 if field < 0:
144 raise SpecValidationError(f"{field_name} can't be negative")
145
146
147def verify_positive_int(field: Any, field_name: str) -> None:

Callers 2

validateMethod · 0.90
verify_positive_intFunction · 0.85

Calls 3

SpecValidationErrorClass · 0.90
verify_numericFunction · 0.85
verify_intFunction · 0.85

Tested by

no test coverage detected