def random_pool_data(): ns_zone = random_zone_data().name data = { "name": random_string(), } ns_records = [] for i in range(0, 2): ns_records.append("ns%s.%s" % (i, ns_zone)) data["ns_records"] = [] return PoolModel.from_dict(data)
def random_pool_data(): ns_zone = random_zone_data().name data = { "name": random_string(), } records = [] for i in range(0, 2): records.append("ns%s.%s" % (i, ns_zone)) ns_records = [{"hostname": x, "priority": random.randint(1, 999)} for x in records] data["ns_records"] = ns_records return PoolModel.from_dict(data)