From 200d0d9ef848da9f7a23995831e8f6537003e181 Mon Sep 17 00:00:00 2001 From: Rob Hudson Date: Tue, 14 May 2013 15:10:06 -0700 Subject: [PATCH] Updated ES_INDEXES to be consistent and based on lib/settings_base --- lib/settings_base.py | 14 +++++++------- sites/altdev/settings_base.py | 6 ++---- sites/dev/settings_base.py | 7 ++----- sites/prod/settings_base.py | 4 +--- sites/stage/settings_base.py | 6 ++---- 5 files changed, 14 insertions(+), 23 deletions(-) diff --git a/lib/settings_base.py b/lib/settings_base.py index 8d7227dda8..00b05bdaf2 100644 --- a/lib/settings_base.py +++ b/lib/settings_base.py @@ -1362,13 +1362,13 @@ BUILDER_VERSIONS_URL = ('https://builder.addons.mozilla.org/repackage/' + ## elasticsearch ES_HOSTS = ['127.0.0.1:9200'] ES_URLS = ['http://%s' % h for h in ES_HOSTS] -ES_INDEXES = {'default': 'amo', - 'webapp': 'mkt', - 'update_counts': 'amo_stats', - 'download_counts': 'amo_stats', - 'stats_contributions': 'amo_stats', - 'stats_collections_counts': 'amo_stats', - 'users_install': 'amo_stats'} +ES_INDEXES = {'default': 'addons', + 'webapp': 'apps', + 'update_counts': 'addons_stats', + 'download_counts': 'addons_stats', + 'stats_contributions': 'addons_stats', + 'stats_collections_counts': 'addons_stats', + 'users_install': 'addons_stats'} ES_TIMEOUT = 30 # Default AMO user id to use for tasks. diff --git a/sites/altdev/settings_base.py b/sites/altdev/settings_base.py index af00f6bccf..ec2a2d19d5 100644 --- a/sites/altdev/settings_base.py +++ b/sites/altdev/settings_base.py @@ -3,7 +3,7 @@ import logging import os -from lib.settings_base import CACHE_PREFIX, KNOWN_PROXIES, LOGGING +from lib.settings_base import CACHE_PREFIX, ES_INDEXES, KNOWN_PROXIES, LOGGING from .. import splitstrip import private_base as private @@ -154,9 +154,7 @@ BUILDER_VERSIONS_URL = "https://builder-addons-dev.allizom.org/repackage/sdk-ver ES_HOSTS = splitstrip(private.ES_HOSTS) ES_URLS = ['http://%s' % h for h in ES_HOSTS] -ES_INDEXES = {'default': 'marketplace_altdev', - 'update_counts': 'marketplace_altdev_stats', - 'download_counts': 'marketplace_altdev_stats'} +ES_INDEXES = dict((k, '%s_altdev' % v) for k, v in ES_INDEXES.items()) BUILDER_UPGRADE_URL = "https://builder-addons-dev.allizom.org/repackage/rebuild/" diff --git a/sites/dev/settings_base.py b/sites/dev/settings_base.py index 04a3f460fc..9992183c01 100644 --- a/sites/dev/settings_base.py +++ b/sites/dev/settings_base.py @@ -5,7 +5,7 @@ import os import dj_database_url -from lib.settings_base import CACHE_PREFIX, KNOWN_PROXIES, LOGGING +from lib.settings_base import CACHE_PREFIX, ES_INDEXES, KNOWN_PROXIES, LOGGING from .. import splitstrip import private_base as private @@ -131,10 +131,7 @@ BUILDER_VERSIONS_URL = "https://builder-addons-dev.allizom.org/repackage/sdk-ver ES_HOSTS = splitstrip(private.ES_HOSTS) ES_URLS = ['http://%s' % h for h in ES_HOSTS] -ES_INDEXES = {'default': 'addons_dev', - 'webapp': 'mkt_dev', - 'update_counts': 'addons_dev_stats', - 'download_counts': 'addons_dev_stats'} +ES_INDEXES = dict((k, '%s_dev' % v) for k, v in ES_INDEXES.items()) BUILDER_UPGRADE_URL = "https://builder-addons-dev.allizom.org/repackage/rebuild/" diff --git a/sites/prod/settings_base.py b/sites/prod/settings_base.py index 476f6fe6ed..f1dc7e2c33 100644 --- a/sites/prod/settings_base.py +++ b/sites/prod/settings_base.py @@ -138,9 +138,7 @@ BUILDER_SECRET_KEY = private.BUILDER_SECRET_KEY ES_HOSTS = splitstrip(private.ES_HOSTS) ES_URLS = ['http://%s' % h for h in ES_HOSTS] -ES_INDEXES = {'default': 'addons', - 'update_counts': 'addons_stats', - 'download_counts': 'addons_stats'} +# ES_INDEXES doesn't change for prod. BUILDER_UPGRADE_URL = "https://builder.addons.mozilla.org/repackage/rebuild/" diff --git a/sites/stage/settings_base.py b/sites/stage/settings_base.py index 9f4bb2344e..42c7da45aa 100644 --- a/sites/stage/settings_base.py +++ b/sites/stage/settings_base.py @@ -3,7 +3,7 @@ import logging import os -from lib.settings_base import CACHE_PREFIX, KNOWN_PROXIES, LOGGING +from lib.settings_base import CACHE_PREFIX, ES_INDEXES, KNOWN_PROXIES, LOGGING from .. import splitstrip import private_base as private @@ -149,9 +149,7 @@ BUILDER_VERSIONS_URL = "https://builder-addons.allizom.org/repackage/sdk-version ES_HOSTS = splitstrip(private.ES_HOSTS) ES_URLS = ['http://%s' % h for h in ES_HOSTS] -ES_INDEXES = {'default': 'marketplace_stage', - 'update_counts': 'marketplace_stage_stats', - 'download_counts': 'marketplace_stage_stats'} +ES_INDEXES = dict((k, '%s_stage' % v) for k, v in ES_INDEXES.items()) BUILDER_UPGRADE_URL = "https://builder-addons.allizom.org/repackage/rebuild/"