INNER CODE UNIT · Python
indices_stats_fields_parser
braedon/prometheus-es-exporter · prometheus_es_exporter/__init__.py:360
def indices_stats_fields_parser(ctx, param, value):
if value is None:
return None
if value == '*':
return value
else:
return value.split(',')
def split_http_header(header_string):
"""Splits a colon-separated string into header and value"""
parts = tuple(part.strip() for part in header_string.split(":", 1))
if len(parts) != 2 or any(part == '' for part in parts):
msg = "Invalid header '{}'. Use colon to separate name and value".format(header_string)
raise click.BadParameter(msg)
return parts