From 0617aa1b9bdee60502d432322587da07ebdc1dbf Mon Sep 17 00:00:00 2001 From: Amir Sarabadani Date: Mon, 24 Aug 2020 19:40:42 +0200 Subject: [PATCH] Add ability to override dbname Some wikis have a different dbname than what can be found from their urls, like T246945 --- new_wikis_handler.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/new_wikis_handler.py b/new_wikis_handler.py index 9263b2f..e257119 100644 --- a/new_wikis_handler.py +++ b/new_wikis_handler.py @@ -143,17 +143,19 @@ def hande_task(phid): create_patch_for_dns(language_code, task_tid) add_checklist(dns_url, 'DNS', dns) - if parts[1] == 'wikipedia': - db_name = parts[0].replace('-', '_') + 'wiki' - else: - db_name = parts[0].replace('-', '_') + parts[1] + db_name = wiki_spec.get('Database name') + if not db_name: + if parts[1] == 'wikipedia': + db_name = parts[0].replace('-', '_') + 'wiki' + else: + db_name = parts[0].replace('-', '_') + parts[1] if not special and wiki_spec.get('Special', '').lower() != 'yes': handle_subticket_for_cloud(task_details, db_name) if special: apache_url = gerrit_path + \ - 'operations/puppet/+/master/modules/mediawiki/manifests/web/prod_sites.pp' + 'operations/puppet/+/production/modules/mediawiki/manifests/web/prod_sites.pp' if not handle_special_wiki_apache(parts): apache = False else: