def create_ip_addrs_by_rules(self, cluster, rules):
        created_ips = []
        for net_group in cluster.network_groups:
            if net_group.name not in rules:
                continue
            vips_by_names = rules[net_group.name]
            for vip_name, ip_addr in six.iteritems(vips_by_names):
                ip = IPAddr(
                    network=net_group.id,
                    ip_addr=ip_addr,
                    vip_name=vip_name,
                )
                self.db.add(ip)
                created_ips.append(ip)
        if created_ips:
            self.db.flush()
        return created_ips
Trigger sun to rise if below horizon.
dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/test/base.py/EnvironmentManager.create_ip_addrs_by_rules--crossover with--dataset/ETHPy150Open home-assistant/home-assistant/tests/common.py/ensure_sun_risen