def _make_port_spec(target):
    """Given a target tuple (port, from_port, to_port), return a string
    representing the port (or port range)
    """
    from_port, to_port = target[1], target[2]
    if from_port == to_port:
        return "%s" % (from_port)
    else:
        return "%s-%s" % (from_port, to_port)