Commit 969fc7df by Mike Dikan Committed by mikedikan

Update remove index approach to match AWS

ECOM-7297

AWS ES doesn't support the settings request. We need to update the way we fetch the indexes to use something else that is supported.
parent a51d35ff
...@@ -66,7 +66,10 @@ class Command(BaseCommand): ...@@ -66,7 +66,10 @@ class Command(BaseCommand):
Returns: Returns:
sorted_indexes_by_timestamp (list): The sorted listing of index names sorted_indexes_by_timestamp (list): The sorted listing of index names
""" """
all_index_settings = indices_client.get_settings() # Elasticsearch in AWS is not a full implementation of ES, and we need to use the (more verbose) status
all_indexes = list(all_index_settings.keys()) # endpoint instead of the (more succinct) settings endpoint. For more information, see
# http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es_version_1_5.html
all_index_status = indices_client.status()
all_indexes = list(all_index_status['indices'].keys())
all_current_indexes = [index_name for index_name in all_indexes if index_name.startswith(index_prefix + '_')] all_current_indexes = [index_name for index_name in all_indexes if index_name.startswith(index_prefix + '_')]
return sorted(all_current_indexes) return sorted(all_current_indexes)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment