def gen_netmask(min_cidr=1, max_cidr=31):
    if min_cidr < 0:
        raise ValueError(
            'min_cidr must be 0 or greater, but is {0}'.format(min_cidr)
        )
    if max_cidr >= len(VALID_NETMASKS):
        raise ValueError(
            'max_cidr must be less than {0}, but is {1}'
            .format(len(VALID_NETMASKS), max_cidr)
        )
    random.seed()
    return VALID_NETMASKS[random.randint(min_cidr, max_cidr)]
Generates a random valid netmask.
dataset/ETHPy150Open omaciel/fauxfactory/fauxfactory/__init__.py/gen_netmask