Skip to content

Commit

Permalink
Merge pull request #895 from untergeek/refactor/894
Browse files Browse the repository at this point in the history
Refactor get_aliases to get_alias
  • Loading branch information
untergeek committed Feb 24, 2017
2 parents b6860cc + d854601 commit 7e5c31e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion curator/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def remove(self, ilo, warn_if_no_indices=False):
else:
# Re-raise the NoIndices so it will behave as before
raise NoIndices
aliases = self.client.indices.get_aliases()
aliases = self.client.indices.get_alias()
for index in ilo.working_list():
if index in aliases:
self.loggit.debug(
Expand Down
2 changes: 1 addition & 1 deletion test/integration/test_alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def test_remove_index_not_in_alias(self):
)
self.assertEqual(
{'my_index1': {'aliases': {}}, 'my_index2': {'aliases': {}}},
self.client.indices.get_aliases()
self.client.indices.get_alias()
)
self.assertEqual(0, result.exit_code)
def test_no_add_remove(self):
Expand Down
4 changes: 2 additions & 2 deletions test/unit/test_action_alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_remove_single(self):
client.indices.get_settings.return_value = testvars.settings_one
client.cluster.state.return_value = testvars.clu_state_one
client.indices.stats.return_value = testvars.stats_one
client.indices.get_aliases.return_value = testvars.settings_1_get_aliases
client.indices.get_alias.return_value = testvars.settings_1_get_aliases
ilo = curator.IndexList(client)
ao = curator.Alias(name='my_alias')
ao.remove(ilo)
Expand All @@ -77,7 +77,7 @@ def test_remove_multiple(self):
client.indices.get_settings.return_value = testvars.settings_two
client.cluster.state.return_value = testvars.clu_state_two
client.indices.stats.return_value = testvars.stats_two
client.indices.get_aliases.return_value = testvars.settings_2_get_aliases
client.indices.get_alias.return_value = testvars.settings_2_get_aliases
ilo = curator.IndexList(client)
ao = curator.Alias(name='my_alias')
ao.remove(ilo)
Expand Down

0 comments on commit 7e5c31e

Please sign in to comment.