(val)
| 553 | |
| 554 | |
| 555 | def 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 | |
| 576 | def validate_reload_engine(val): |
nothing calls this directly
no test coverage detected