# -*- coding: utf-8 -*-
# Copyright (c) 2020, JINGROW
# For license information, please see license.txt


import jingrow
from jingrow.utils.fixtures import sync_fixtures


def execute():
	sync_fixtures("jcloud")
	domains = jingrow.get_all(
		"Site Domain", fields=["site", "domain", "name"], filters={"status": "Active"}
	)

	for domain in domains:
		site_pg = jingrow.get_pg("Site", domain.site)
		site_pg.add_domain_to_config(domain.domain)
