'Iterate over hosts within an address range.
If an explicit range specifier is missing, the parameter is
interpreted as a specific individual address.'

@staticmethod
def address_to_hosts(addresses):

    try:
        return [netaddr.IPAddress(addresses)]
    except ValueError:
        net = netaddr.IPNetwork(addresses)
        if (net.size < 4):
            reason = (_('/%s    should    be    specified    as    single    address(es)    not    in    cidr    format') % net.prefixlen)
            raise exception.InvalidInput(reason=reason)
        elif (net.size >= 1000000):
            reason = (_('Too    many    IP    addresses    will    be    generated.        Please    increase    /%s    to    reduce    the    number    generated.') % net.prefixlen)
            raise exception.InvalidInput(reason=reason)
        else:
            return net.iter_hosts()
