MCPcopy
hub / github.com/benoitc/gunicorn / validate_statsd_address

Function validate_statsd_address

gunicorn/config.py:555–573  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

553
554
555def validate_statsd_address(val):
556 val = validate_string(val)
557 if val is None:
558 return None
559
560 # As of major release 20, util.parse_address would recognize unix:PORT
561 # as a UDS address, breaking backwards compatibility. We defend against
562 # that regression here (this is also unit-tested).
563 # Feel free to remove in the next major release.
564 unix_hostname_regression = re.match(r'^unix:(\d+)$', val)
565 if unix_hostname_regression:
566 return ('unix', int(unix_hostname_regression.group(1)))
567
568 try:
569 address = util.parse_address(val, default_port='8125')
570 except RuntimeError:
571 raise TypeError("Value must be one of ('host:port', 'unix://PATH')")
572
573 return address
574
575
576def validate_reload_engine(val):

Callers

nothing calls this directly

Calls 1

validate_stringFunction · 0.85

Tested by

no test coverage detected