def host_and_port(value):
    """
    Parse "host:port" string into (host, port) tuple.

    >>> host_and_port('host:1')
    ('host', 1)
    >>> host_and_port(' host:1 ')
    ('host', 1)
    >>> host_and_port('host:foo')
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "reloadconf/__main__.py", line 33, in host_and_port
        return host.strip(), int(port.strip())
    ValueError: invalid literal for int() with base 10: 'foo'
    """
    host, port = value.split(':')

    return host.strip(), int(port.strip())