summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2020-07-13 11:45:57 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2020-07-13 11:45:57 (GMT)
commitdbff27c5a652118580450d3e44779831353f8e93 (patch)
tree49063467f37d0bb9a2ee58e6bd3a51edb6301028
parent08cc64357536b0d44d7ba3863608fcca8af6608b (diff)
downloadmisc-fred-dbff27c5a652118580450d3e44779831353f8e93.zip
misc-fred-dbff27c5a652118580450d3e44779831353f8e93.tar.gz
misc-fred-dbff27c5a652118580450d3e44779831353f8e93.tar.bz2
grandlyon/scripts: adapt hostnames for production
-rw-r--r--grandlyon/scripts/copy-portal-agent.py10
-rw-r--r--grandlyon/scripts/copy-portal-users.py10
-rwxr-xr-xgrandlyon/scripts/copy-wcs.py10
3 files changed, 21 insertions, 9 deletions
diff --git a/grandlyon/scripts/copy-portal-agent.py b/grandlyon/scripts/copy-portal-agent.py
index 7d165ba..8a4051e 100644
--- a/grandlyon/scripts/copy-portal-agent.py
+++ b/grandlyon/scripts/copy-portal-agent.py
@@ -10,11 +10,15 @@ from django.utils.text import slugify
orig_city= sys.argv[1]
slug_orig_city = slugify(orig_city)
-orig_site = 'portail-agent-%s.guichet-recette.grandlyon.com' % slug_orig_city
-
dest_city = sys.argv[2]
slug_dest_city = slugify(dest_city)
-dest_site = 'portail-agent-%s.guichet-recette.grandlyon.com' % slug_dest_city
+
+if os.path.exists('/var/lib/combo/tenants/www.toodego.com'):
+ orig_site = 'agents-%s.toodego.com' % slug_orig_city
+ dest_site = 'agents-%s.toodego.com' % slug_dest_city
+else:
+ orig_site = 'portail-agent-%s.guichet-recette.grandlyon.com' % slug_orig_city
+ dest_site = 'portail-agent-%s.guichet-recette.grandlyon.com' % slug_dest_city
site_export_orig = subprocess.check_output(['sudo', '-u', 'combo', 'combo-manage', 'tenant_command', 'export_site', '-d', orig_site])
site_export_orig = site_export_orig.decode('utf-8')
diff --git a/grandlyon/scripts/copy-portal-users.py b/grandlyon/scripts/copy-portal-users.py
index fd3a8ab..de6b2a1 100644
--- a/grandlyon/scripts/copy-portal-users.py
+++ b/grandlyon/scripts/copy-portal-users.py
@@ -10,11 +10,15 @@ from django.utils.text import slugify
orig_city= sys.argv[1]
slug_orig_city = slugify(orig_city)
-orig_site = 'portail-citoyen-%s.guichet-recette.grandlyon.com' % slug_orig_city
-
dest_city = sys.argv[2]
slug_dest_city = slugify(dest_city)
-dest_site = 'portail-citoyen-%s.guichet-recette.grandlyon.com' % slug_dest_city
+
+if os.path.exists('/var/lib/combo/tenants/www.toodego.com'):
+ orig_site = '%s.toodego.com' % slug_orig_city
+ dest_site = '%s.toodego.com' % slug_dest_city
+else:
+ orig_site = 'portail-citoyen-%s.guichet-recette.grandlyon.com' % slug_orig_city
+ dest_site = 'portail-citoyen-%s.guichet-recette.grandlyon.com' % slug_dest_city
site_export_orig = subprocess.check_output(['sudo', '-u', 'combo', 'combo-manage', 'tenant_command', 'export_site', '-d', orig_site])
site_export_orig = site_export_orig.decode('utf-8')
diff --git a/grandlyon/scripts/copy-wcs.py b/grandlyon/scripts/copy-wcs.py
index f54fb3a..84a7667 100755
--- a/grandlyon/scripts/copy-wcs.py
+++ b/grandlyon/scripts/copy-wcs.py
@@ -13,11 +13,15 @@ from django.utils.text import slugify
orig_city = sys.argv[1]
slug_orig_city = slugify(orig_city)
-orig_site = 'demarches-%s.guichet-recette.grandlyon.com' % slug_orig_city
-
dest_city = sys.argv[2]
slug_dest_city = slugify(dest_city)
-dest_site = 'demarches-%s.guichet-recette.grandlyon.com' % slug_dest_city
+
+if os.path.exists('/var/lib/combo/tenants/www.toodego.com'):
+ orig_site = 'demarches-%s.toodego.com' % slug_orig_city
+ dest_site = 'demarches-%s.toodego.com' % slug_dest_city
+else:
+ orig_site = 'demarches-%s.guichet-recette.grandlyon.com' % slug_orig_city
+ dest_site = 'demarches-%s.guichet-recette.grandlyon.com' % slug_dest_city
roles_mapping = json.load(open('/tmp/roles.mapping.json'))