Function to return a whole subnet value from a IP address and CIDR pair
    Args:
        ip_addr: Unicast or Multicast IP address or subnet in the following format 192.168.1.1, 239.1.1.1
        cidr: CIDR value of 0 to 32

    Returns: returns the corrected whole subnet

def whole_subnet_maker(ip_addr, cidr):
    """
    Function to return a whole subnet value from a IP address and CIDR pair
    Args:
        ip_addr: Unicast or Multicast IP address or subnet in the following format 192.168.1.1, 239.1.1.1
        cidr: CIDR value of 0 to 32

    Returns: returns the corrected whole subnet

    """
    if ucast_ip(ip_addr, False) == False and mcast_ip(ip_addr, False) == False:
        LOGGER.critical('Function whole_subnet_maker ip_addr {item}'.format(item=ip_addr))
        raise ValueError("Not a good ipv4 address")
    if not cidr_check(cidr, False):
        LOGGER.critical('Function whole_subnet_maker cidr {item}'.format(item=cidr))
        raise ValueError("Not a good CIDR value should be 0 to 32")

    def subnet_corrector(octet, cidr):
        """ Function to correct a octet for a subnet """
        cidr_int = int(cidr)
        octet_int = int(octet)
        if cidr_int >= 24:
            cidr_int = __mask_conversion[cidr_int]["OCT4"]
        elif cidr_int >= 16:
            cidr_int = __mask_conversion[cidr_int]["OCT3"]
        elif cidr_int >= 8:
            cidr_int = __mask_conversion[cidr_int]["OCT2"]
        elif cidr_int >= 1:
            cidr_int = __mask_conversion[cidr_int]["OCT1"]
        cidr_count = 0
        cidr_v = 256 - cidr_int
        cidr_2 = 256 - cidr_int
        while cidr_count < 300:
            if octet_int >= cidr_count and octet_int <= cidr_2:
                    cidr_int = cidr_count
            cidr_count = cidr_2
            cidr_2 = cidr_2 + cidr_v
        return str(cidr_int)
    ip_addr_split = ip_addr.split(".")
    if int(cidr) >= 24:
        octet = subnet_corrector(ip_addr_split[3], cidr)
        completed = ip_addr_split[0] + "." + ip_addr_split[1] + "." + ip_addr_split[2] + "." + octet
        return completed
    elif int(cidr) >= 16:
        octet = subnet_corrector(ip_addr_split[2], cidr)
        completed = ip_addr_split[0] + "." + ip_addr_split[1] + "." + octet + ".0"
        return completed
    elif int(cidr) >= 8:
        octet = subnet_corrector(ip_addr_split[1], cidr)
        completed = ip_addr_split[0] + "." + octet + ".0.0"
        return completed
    elif int(cidr) >= 1:
        octet = subnet_corrector(ip_addr_split[0], cidr)
        completed = octet + ".0.0.0"
        return completed
    else:
        return "0.0.0.0"