[Python-modules-commits] [elasticsearch-curator] 01/06: Import elasticsearch-curator_4.2.5.orig.tar.gz

Apollon Oikonomopoulos apoikos at moszumanska.debian.org
Mon Jan 2 13:04:34 UTC 2017


This is an automated email from the git hooks/post-receive script.

apoikos pushed a commit to branch master
in repository elasticsearch-curator.

commit 0853854035a54106dd650b5d39fbd1691e4712a6
Author: Apollon Oikonomopoulos <apoikos at debian.org>
Date:   Mon Jan 2 14:57:29 2017 +0200

    Import elasticsearch-curator_4.2.5.orig.tar.gz
---
 .travis.yml                                |  3 +-
 curator/_version.py                        |  2 +-
 curator/singletons.py                      | 47 ++++++++++++------------------
 docs/Changelog.rst                         | 24 +++++++++++++++
 docs/asciidoc/actions.asciidoc             | 30 +++++++++----------
 docs/asciidoc/configuration.asciidoc       |  2 +-
 docs/asciidoc/examples.asciidoc            | 24 +++++++--------
 docs/asciidoc/faq.asciidoc                 |  2 +-
 docs/asciidoc/filter_elements.asciidoc     |  2 ++
 docs/asciidoc/filters.asciidoc             | 30 ++++++++++---------
 docs/asciidoc/inc_filter_chaining.asciidoc | 23 +++++++++++++++
 docs/asciidoc/index.asciidoc               |  2 +-
 docs/asciidoc/installation.asciidoc        |  2 +-
 test/integration/test_cli.py               | 14 ++++++++-
 14 files changed, 132 insertions(+), 75 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index c22ffc1..ebc976d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -11,7 +11,8 @@ env:
   - ES_VERSION=2.2.2
   - ES_VERSION=2.3.5
   - ES_VERSION=2.4.2
-  - ES_VERSION=5.0.0
+  - ES_VERSION=5.0.2
+  - ES_VERSION=5.1.1
 
 os: linux
 
diff --git a/curator/_version.py b/curator/_version.py
index 4b08b59..a10ee5c 100644
--- a/curator/_version.py
+++ b/curator/_version.py
@@ -1 +1 @@
-__version__ = '4.2.4'
+__version__ = '4.2.5'
diff --git a/curator/singletons.py b/curator/singletons.py
index 18e84f1..8bd85dd 100644
--- a/curator/singletons.py
+++ b/curator/singletons.py
@@ -81,10 +81,11 @@ def _actionator(action, action_obj, dry_run=True):
         sys.exit(1)
     logger.info('Singleton "{0}" action completed.'.format(action))
 
-def _check_empty_list(list_object, ignore=False):
+def _do_filters(list_object, filters, ignore=False):
     logger = logging.getLogger(__name__)
-    logger.debug('Testing for empty list object')
+    logger.debug('Running filters and testing for empty list object')
     try:
+        list_object.iterate_filters(filters)
         list_object.empty_list_check()
     except (NoIndices, NoSnapshots) as e:
         if str(type(e)) == "<class 'curator.exceptions.NoIndices'>":
@@ -192,8 +193,7 @@ def allocation_singleton(
         'filters': filter_schema_check(action, filter_list)
     }
     ilo = IndexList(client)
-    ilo.iterate_filters(clean_filters)
-    _check_empty_list(ilo, ignore_empty_list)
+    _do_filters(ilo, clean_filters, ignore_empty_list)
     action_obj = action_class(ilo, **mykwargs)
     ### Do the action
     _actionator(action, action_obj, dry_run=ctx.parent.params['dry_run'])
@@ -231,8 +231,7 @@ def close_singleton(
         'filters': filter_schema_check(action, filter_list)
     }
     ilo = IndexList(client)
-    ilo.iterate_filters(clean_filters)
-    _check_empty_list(ilo, ignore_empty_list)
+    _do_filters(ilo, clean_filters, ignore_empty_list)
     action_obj = action_class(ilo, **mykwargs)
     ### Do the action
     _actionator(action, action_obj, dry_run=ctx.parent.params['dry_run'])
@@ -265,8 +264,7 @@ def delete_indices_singleton(ctx, ignore_empty_list, filter_list):
         'filters': filter_schema_check(action, filter_list)
     }
     ilo = IndexList(client)
-    ilo.iterate_filters(clean_filters)
-    _check_empty_list(ilo, ignore_empty_list)
+    _do_filters(ilo, clean_filters, ignore_empty_list)
     action_obj = action_class(ilo, **mykwargs)
     ### Do the action
     _actionator(action, action_obj, dry_run=ctx.parent.params['dry_run'])
@@ -315,8 +313,7 @@ def delete_snapshots_singleton(
         'filters': filter_schema_check(action, filter_list)
     }
     slo = SnapshotList(client, repository=repository)
-    slo.iterate_filters(clean_filters)
-    _check_empty_list(slo, ignore_empty_list)
+    _do_filters(slo, clean_filters, ignore_empty_list)
     action_obj = action_class(slo, **mykwargs)
     ### Do the action
     _actionator(action, action_obj, dry_run=ctx.parent.params['dry_run'])
@@ -347,8 +344,7 @@ def open_singleton(
         'filters': filter_schema_check(action, filter_list)
     }
     ilo = IndexList(client)
-    ilo.iterate_filters(clean_filters)
-    _check_empty_list(ilo, ignore_empty_list)
+    _do_filters(ilo, clean_filters, ignore_empty_list)
     action_obj = action_class(ilo)
     ### Do the action
     _actionator(action, action_obj, dry_run=ctx.parent.params['dry_run'])
@@ -393,8 +389,7 @@ def forcemerge_singleton(
         'filters': filter_schema_check(action, filter_list)
     }
     ilo = IndexList(client)
-    ilo.iterate_filters(clean_filters)
-    _check_empty_list(ilo, ignore_empty_list)
+    _do_filters(ilo, clean_filters, ignore_empty_list)
     action_obj = action_class(ilo, **mykwargs)
     ### Do the action
     _actionator(action, action_obj, dry_run=ctx.parent.params['dry_run'])
@@ -437,8 +432,7 @@ def replicas_singleton(
         'filters': filter_schema_check(action, filter_list)
     }
     ilo = IndexList(client)
-    ilo.iterate_filters(clean_filters)
-    _check_empty_list(ilo, ignore_empty_list)
+    _do_filters(ilo, clean_filters, ignore_empty_list)
     action_obj = action_class(ilo, **mykwargs)
     ### Do the action
     _actionator(action, action_obj, dry_run=ctx.parent.params['dry_run'])
@@ -478,8 +472,8 @@ def replicas_singleton(
     help='Do not raise exception if there are no actionable indices'
 )
 @click.option(
-    '--filter_list', callback=validate_filter_json,
-    help='JSON string representing an array of filters.', required=True
+    '--filter_list', callback=validate_filter_json, default='{"filtertype":"none"}',
+    help='JSON string representing an array of filters.'
 )
 @click.pass_context
 def snapshot_singleton(
@@ -509,8 +503,7 @@ def snapshot_singleton(
         'filters': filter_schema_check(action, filter_list)
     }
     ilo = IndexList(client)
-    ilo.iterate_filters(clean_filters)
-    _check_empty_list(ilo, ignore_empty_list)
+    _do_filters(ilo, clean_filters, ignore_empty_list)
     action_obj = action_class(ilo, **mykwargs)
     ### Do the action
     _actionator(action, action_obj, dry_run=ctx.parent.params['dry_run'])
@@ -525,8 +518,8 @@ def snapshot_singleton(
     help='Do not raise exception if there are no actionable indices'
 )
 @click.option(
-    '--filter_list', callback=validate_filter_json,
-    help='JSON string representing an array of filters.', required=True
+    '--filter_list', callback=validate_filter_json, default='{"filtertype":"none"}',
+    help='JSON string representing an array of filters.'
 )
 @click.pass_context
 def show_indices_singleton(
@@ -547,8 +540,7 @@ def show_indices_singleton(
         'filters': filter_schema_check(action, filter_list)
     }
     ilo = IndexList(client)
-    ilo.iterate_filters(clean_filters)
-    _check_empty_list(ilo, ignore_empty_list)
+    _do_filters(ilo, clean_filters, ignore_empty_list)
     indices = sorted(ilo.indices)
     # Do some calculations to figure out the proper column sizes
     allbytes = []
@@ -606,8 +598,8 @@ def show_indices_singleton(
     help='Do not raise exception if there are no actionable snapshots'
 )
 @click.option(
-    '--filter_list', callback=validate_filter_json,
-    help='JSON string representing an array of filters.', required=True
+    '--filter_list', callback=validate_filter_json, default='{"filtertype":"none"}',
+    help='JSON string representing an array of filters.'
 )
 @click.pass_context
 def show_snapshots_singleton(
@@ -624,8 +616,7 @@ def show_snapshots_singleton(
         'filters': filter_schema_check(action, filter_list)
     }
     slo = SnapshotList(client, repository=repository)
-    slo.iterate_filters(clean_filters)
-    _check_empty_list(slo, ignore_empty_list)
+    _do_filters(slo, clean_filters, ignore_empty_list)
     snapshots = sorted(slo.snapshots)
     for idx in snapshots:
         click.secho('{0}'.format(idx))
diff --git a/docs/Changelog.rst b/docs/Changelog.rst
index 6d60fa4..5e4c284 100644
--- a/docs/Changelog.rst
+++ b/docs/Changelog.rst
@@ -3,6 +3,30 @@
 Changelog
 =========
 
+4.2.5 (22 December 2016)
+------------------------
+
+**General**
+
+  * Add and increment test versions for Travis CI. #839 (untergeek)
+  * Make `filter_list` optional in snapshot, show_snapshot and show_indices
+    singleton actions. #853 (alexef)
+
+**Bug Fixes**
+
+  * Fix cli integration test when different host/port are specified.  Reported
+    in #843 (untergeek)
+  * Catch empty list condition during filter iteration in singleton actions.
+    Reported in #848 (untergeek)
+
+**Documentation**
+
+  * Add docs regarding how filters are ANDed together, and how to do an OR with
+    the regex pattern filter type. Requested in #842 (untergeek)
+  * Fix typo in Click version in docs. #850 (breml)
+  * Where applicable, replace `[source,text]` with `[source,yaml]` for better
+    formatting in the resulting docs.
+
 4.2.4 (7 December 2016)
 -----------------------
 
diff --git a/docs/asciidoc/actions.asciidoc b/docs/asciidoc/actions.asciidoc
index 8841158..d883f1e 100644
--- a/docs/asciidoc/actions.asciidoc
+++ b/docs/asciidoc/actions.asciidoc
@@ -24,7 +24,7 @@ once created, can only be deleted.
 [[alias]]
 == Alias
 
-[source,text]
+[source,yaml]
 -------------
 action: alias
 description: "Add/Remove selected indices to or from the specified alias"
@@ -57,7 +57,7 @@ The <<option_extra_settings,extra_settings>> option allows the addition of extra
 settings with the `add` directive.  These settings are ignored for `remove`.  An
 example of how these settings can be used to create a filtered alias might be:
 
-[source,text]
+[source,yaml]
 -------------
 extra_settings:
   filter:
@@ -95,7 +95,7 @@ TIP: See an example of this action in an <<actionfile,actionfile>>
 [[allocation]]
 == Allocation
 
-[source,text]
+[source,yaml]
 -------------
 action: allocation
 description: "Apply shard allocation filtering rules to the specified indices"
@@ -154,7 +154,7 @@ TIP: See an example of this action in an <<actionfile,actionfile>>
 [[close]]
 == Close
 
-[source,text]
+[source,yaml]
 -------------
 action: close
 description: "Close selected indices"
@@ -193,7 +193,7 @@ TIP: See an example of this action in an <<actionfile,actionfile>>
 [[cluster_routing]]
 == Cluster Routing
 
-[source,text]
+[source,yaml]
 -------------
 action: cluster_routing
 description: "Apply routing rules to the entire cluster"
@@ -250,7 +250,7 @@ TIP: See an example of this action in an <<actionfile,actionfile>>
 [[create_index]]
 == Create Index
 
-[source,text]
+[source,yaml]
 -------------
 action: create_index
 description: "Create index as named"
@@ -272,7 +272,7 @@ The <<option_extra_settings,extra_settings>> option allows the addition of extra
 settings, such as index settings and mappings.  An example of how these settings
 can be used to create an index might be:
 
-[source,text]
+[source,yaml]
 -------------
 extra_settings:
   settings:
@@ -311,7 +311,7 @@ TIP: See an example of this action in an <<actionfile,actionfile>>
 [[delete_indices]]
 == Delete Indices
 
-[source,text]
+[source,yaml]
 -------------
 action: delete_indices
 description: "Delete selected indices"
@@ -347,7 +347,7 @@ TIP: See an example of this action in an <<actionfile,actionfile>>
 [[delete_snapshots]]
 == Delete Snapshots
 
-[source,text]
+[source,yaml]
 -------------
 action: delete_snapshots
 description: "Delete selected snapshots from 'repository'"
@@ -399,7 +399,7 @@ TIP: See an example of this action in an <<actionfile,actionfile>>
 [[open]]
 == Open
 
-[source,text]
+[source,yaml]
 -------------
 action: open
 description: "open selected indices"
@@ -435,7 +435,7 @@ TIP: See an example of this action in an <<actionfile,actionfile>>
 [[forcemerge]]
 == Forcemerge
 
-[source,text]
+[source,yaml]
 -------------
 action: forcemerge
 description: "Perform a forceMerge on selected indices to 'max_num_segments' per shard"
@@ -483,7 +483,7 @@ TIP: See an example of this action in an <<actionfile,actionfile>>
 [[replicas]]
 == Replicas
 
-[source,text]
+[source,yaml]
 -------------
 action: replicas
 description: >- Set the number of replicas per shard for selected
@@ -534,7 +534,7 @@ TIP: See an example of this action in an <<actionfile,actionfile>>
 [[restore]]
 == Restore
 
-[source,text]
+[source,yaml]
 -------------
 actions:
   1:
@@ -584,7 +584,7 @@ The <<option_extra_settings,extra_settings>> option allows the addition of extra
 settings, such as index settings and mappings.  An example of how these settings
 can be used to change settings for an index being restored might be:
 
-[source,text]
+[source,yaml]
 -------------
 extra_settings:
   settings:
@@ -639,7 +639,7 @@ TIP: See an example of this action in an <<actionfile,actionfile>>
 [[snapshot]]
 == Snapshot
 
-[source,text]
+[source,yaml]
 -------------
 action: snapshot
 description: >-
diff --git a/docs/asciidoc/configuration.asciidoc b/docs/asciidoc/configuration.asciidoc
index 6848ed3..7a71850 100644
--- a/docs/asciidoc/configuration.asciidoc
+++ b/docs/asciidoc/configuration.asciidoc
@@ -157,7 +157,7 @@ documentation.
 This is an optional description which can help describe what the action and its
 filters are supposed to do.
 
-[source,text]
+[source,yaml]
 -------------
 description: >- I can make the description span multiple
     lines by putting ">-" at the beginning of the line,
diff --git a/docs/asciidoc/examples.asciidoc b/docs/asciidoc/examples.asciidoc
index 9770ebe..c547c49 100644
--- a/docs/asciidoc/examples.asciidoc
+++ b/docs/asciidoc/examples.asciidoc
@@ -26,7 +26,7 @@ configuration files.
 [[ex_alias]]
 == alias
 
-[source,text]
+[source,yaml]
 -------------
 ---
 # Remember, leave a key empty if there is no value.  None will be a string,
@@ -84,7 +84,7 @@ actions:
 [[ex_allocation]]
 == allocation
 
-[source,text]
+[source,yaml]
 -------------
 ---
 # Remember, leave a key empty if there is no value.  None will be a string,
@@ -124,7 +124,7 @@ actions:
 [[ex_close]]
 == close
 
-[source,text]
+[source,yaml]
 -------------
 ---
 # Remember, leave a key empty if there is no value.  None will be a string,
@@ -162,7 +162,7 @@ actions:
 [[ex_cluster_routing]]
 == cluster_routing
 
-[source,text]
+[source,yaml]
 -------------
 ---
 # Remember, leave a key empty if there is no value.  None will be a string,
@@ -209,7 +209,7 @@ actions:
 [[ex_create_index]]
 == create_index
 
-[source,text]
+[source,yaml]
 -------------
 ---
 # Remember, leave a key empty if there is no value.  None will be a string,
@@ -237,7 +237,7 @@ actions:
 [[ex_delete_indices]]
 == delete_indices
 
-[source,text]
+[source,yaml]
 -------------
 ---
 # Remember, leave a key empty if there is no value.  None will be a string,
@@ -275,7 +275,7 @@ actions:
 [[ex_delete_snapshots]]
 == delete_snapshots
 
-[source,text]
+[source,yaml]
 -------------
 ---
 # Remember, leave a key empty if there is no value.  None will be a string,
@@ -312,7 +312,7 @@ actions:
 [[ex_forcemerge]]
 == forcemerge
 
-[source,text]
+[source,yaml]
 -------------
 ---
 # Remember, leave a key empty if there is no value.  None will be a string,
@@ -352,7 +352,7 @@ actions:
 [[ex_open]]
 == open
 
-[source,text]
+[source,yaml]
 -------------
 ---
 # Remember, leave a key empty if there is no value.  None will be a string,
@@ -395,7 +395,7 @@ actions:
 [[ex_replicas]]
 == replicas
 
-[source,text]
+[source,yaml]
 -------------
 ---
 # Remember, leave a key empty if there is no value.  None will be a string,
@@ -432,7 +432,7 @@ actions:
 [[ex_restore]]
 == restore
 
-[source,text]
+[source,yaml]
 -------------
 ---
 # Remember, leave a key empty if there is no value.  None will be a string,
@@ -480,7 +480,7 @@ actions:
 [[ex_snapshot]]
 == snapshot
 
-[source,text]
+[source,yaml]
 -------------
 ---
 # Remember, leave a key empty if there is no value.  None will be a string,
diff --git a/docs/asciidoc/faq.asciidoc b/docs/asciidoc/faq.asciidoc
index a577514..0100650 100644
--- a/docs/asciidoc/faq.asciidoc
+++ b/docs/asciidoc/faq.asciidoc
@@ -162,7 +162,7 @@ The last index can be deleted with a regular expression of `'.*e$'`.
 
 The resulting <<actionfile,actionfile>> might look like this:
 
-[source,text]
+[source,yaml]
 --------
 actions:
   1:
diff --git a/docs/asciidoc/filter_elements.asciidoc b/docs/asciidoc/filter_elements.asciidoc
index d94c10b..7b786ee 100644
--- a/docs/asciidoc/filter_elements.asciidoc
+++ b/docs/asciidoc/filter_elements.asciidoc
@@ -234,6 +234,8 @@ This setting tells the <<filtertype_pattern,pattern>> what pattern type to
 match. Acceptable values for this setting are `prefix`, `suffix`, `timestring`,
 and `regex`.
 
+include::inc_filter_chaining.asciidoc[]
+
 There is no default value. This setting must be set by the user or an exception
 will be raised, and execution will halt.
 
diff --git a/docs/asciidoc/filters.asciidoc b/docs/asciidoc/filters.asciidoc
index 310f0cf..23107a9 100644
--- a/docs/asciidoc/filters.asciidoc
+++ b/docs/asciidoc/filters.asciidoc
@@ -6,6 +6,8 @@
 
 Filters are the way to select only the indices (or snapshots) you want.
 
+include::inc_filter_chaining.asciidoc[]
+
 The index filtertypes are:
 
 * <<filtertype_alias,alias>>
@@ -39,7 +41,7 @@ Each filter is defined first by a `filtertype`.  Each filtertype has its own
 settings, or no settings at all.  In a configuration file, filters are defined
 as follows:
 
-[source,text]
+[source,yaml]
 -------------
 - filtertype: *first*
   setting1: ...
@@ -82,7 +84,7 @@ The snapshot filtertypes are:
 [[filtertype_age]]
 == age
 
-[source,text]
+[source,yaml]
 -------------
  - filtertype: age
    source: name
@@ -134,7 +136,7 @@ Optional settings
 [[filtertype_alias]]
 == alias
 
-[source,text]
+[source,yaml]
 -------------
 - filtertype: alias
   aliases:
@@ -163,7 +165,7 @@ Optional settings
 [[filtertype_allocated]]
 == allocated
 
-[source,text]
+[source,yaml]
 -------------
 - filtertype: allocated
   key:
@@ -198,7 +200,7 @@ Optional settings
 [[filtertype_closed]]
 == closed
 
-[source,text]
+[source,yaml]
 -------------
 - filtertype: closed
   exclude: True
@@ -217,7 +219,7 @@ Optional settings
 [[filtertype_count]]
 == count
 
-[source,text]
+[source,yaml]
 -------------
 - filtertype: count
   count: 10
@@ -276,7 +278,7 @@ Index-only settings
 [[filtertype_forcemerged]]
 == forcemerged
 
-[source,text]
+[source,yaml]
 -------------
 - filtertype: forcemerged
   max_num_segments: 2
@@ -307,7 +309,7 @@ Optional settings
 [[filtertype_kibana]]
 == kibana
 
-[source,text]
+[source,yaml]
 -------------
 - filtertype: kibana
   exclude: True
@@ -331,7 +333,7 @@ Optional settings
 [[filtertype_none]]
 == none
 
-[source,text]
+[source,yaml]
 -------------
 - filtertype: none
 -------------
@@ -345,7 +347,7 @@ There are no settings for this <<filtertype,filtertype>>.
 [[filtertype_opened]]
 == opened
 
-[source,text]
+[source,yaml]
 -------------
 - filtertype: opened
   exclude: True
@@ -367,7 +369,7 @@ Optional settings
 [[filtertype_pattern]]
 == pattern
 
-[source,text]
+[source,yaml]
 -------------
 - filtertype: pattern
  kind: prefix
@@ -383,6 +385,8 @@ This <<filtertype,filtertype>> will iterate over the actionable list and match
 indices matching a given pattern.  They will remain in, or be removed from
 the actionable list based on the value of <<fe_exclude,exclude>>.
 
+include::inc_filter_chaining.asciidoc[]
+
 Read more about the different settings for this <<filtertype,filtertype>>:
 
 [float]
@@ -403,7 +407,7 @@ Optional settings
 [[filtertype_space]]
 == space
 
-[source,text]
+[source,yaml]
 -------------
 - filtertype: space
   disk_space: 100
@@ -482,7 +486,7 @@ Optional settings
 [[filtertype_state]]
 == state
 
-[source,text]
+[source,yaml]
 -------------
 - filtertype: state
   state: SUCCESS
diff --git a/docs/asciidoc/inc_filter_chaining.asciidoc b/docs/asciidoc/inc_filter_chaining.asciidoc
new file mode 100644
index 0000000..e01185a
--- /dev/null
+++ b/docs/asciidoc/inc_filter_chaining.asciidoc
@@ -0,0 +1,23 @@
+[NOTE]
+.Filter chaining
+=====================================================================
+It is important to note that while filters can be chained, each is linked by an
+implied logical *AND* operation.  If you want to match from one of several
+different patterns, as with a logical *OR* operation, you can do so with the
+<<filtertype_pattern,pattern>> filtertype using _regex_ as the <<fe_kind,kind>>.
+
+This example shows how to select multiple indices based on them beginning with
+either `alpha-`, `bravo-`, or `charlie-`:
+
+[source,yaml]
+-------------
+  filters:
+  - filtertype: pattern
+    kind: regex
+    value: '^(alpha-|bravo-|charlie-).*$'
+-------------
+
+Explaining all of the different ways in which regular expressions can be used
+is outside the scope of this document, but hopefully this gives you some idea
+of how a regular expression pattern can be used when a logical *OR* is desired.
+=====================================================================
diff --git a/docs/asciidoc/index.asciidoc b/docs/asciidoc/index.asciidoc
index 786cbf1..9858cbb 100644
--- a/docs/asciidoc/index.asciidoc
+++ b/docs/asciidoc/index.asciidoc
@@ -1,4 +1,4 @@
-:curator_version: 4.2.4
+:curator_version: 4.2.5
 :curator_major: 4
 :es_py_version: 2.4.0
 :ref:  http://www.elastic.co/guide/en/elasticsearch/reference/current
diff --git a/docs/asciidoc/installation.asciidoc b/docs/asciidoc/installation.asciidoc
index e172149..6a884b0 100644
--- a/docs/asciidoc/installation.asciidoc
+++ b/docs/asciidoc/installation.asciidoc
@@ -342,7 +342,7 @@ or uncompress and run `python setup.py install`
 Download and install the http://click.pocoo.org/[click] dependency (6.0 or
 greater):
 
-. `wget https://pypi.python.org/packages/source/c/click/click-6.2.tar.gz -O click-6.3.tar.gz`
+. `wget https://pypi.python.org/packages/source/c/click/click-6.3.tar.gz -O click-6.3.tar.gz`
 . `pip install click-6.3.tar.gz`
 
 or uncompress and run `python setup.py install`
diff --git a/test/integration/test_cli.py b/test/integration/test_cli.py
index 17a92a0..f75c921 100644
--- a/test/integration/test_cli.py
+++ b/test/integration/test_cli.py
@@ -37,6 +37,15 @@ class TestCLIMethods(CuratorTestCase):
                     )
         self.assertEqual(-1, result.exit_code)
     def test_no_config(self):
+        # This test checks whether localhost:9200 is provided if no hosts or
+        # port are in the configuration. But in testing, sometimes
+        # TEST_ES_SERVER is set to something other than localhost:9200.  In this
+        # case, the test here would fail.  The if statement at the end now
+        # compensates. See https://github.com/elastic/curator/issues/843
+        localtest = False
+        if (host == 'localhost' or host == '127.0.0.1') and \
+          port == 9200:
+            localtest = True
         self.create_indices(10)
         self.write_config(
             self.args['configfile'],
@@ -54,7 +63,10 @@ class TestCLIMethods(CuratorTestCase):
 
                     ],
                     )
-        self.assertEqual(0, result.exit_code)
+        if localtest:
+            self.assertEqual(0, result.exit_code)
+        else:
+            self.assertEqual(-1, result.exit_code)
     def test_no_logging_config(self):
         self.create_indices(10)
         self.write_config(

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/elasticsearch-curator.git



More information about the Python-modules-commits mailing list