Skip to content

Commit

Permalink
Merge pull request #805 from untergeek/fix/cli_flags
Browse files Browse the repository at this point in the history
Fix a few cli flags
  • Loading branch information
untergeek committed Nov 8, 2016
2 parents 9cdfd05 + 8a5a725 commit 0dc4595
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 8 deletions.
2 changes: 1 addition & 1 deletion curator/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '4.2.0'
__version__ = '4.2.1'
37 changes: 31 additions & 6 deletions curator/singletons.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ def validate_filter_json(ctx, param, value):
except ValueError:
raise click.BadParameter('Invalid JSON: {0}'.format(value))

def false_to_none(ctx, param, value):
try:
if value:
return True
else:
return None
except ValueError:
raise click.BadParameter('Invalid value: {0}'.format(value))

def filter_schema_check(action, filter_dict):
valid_filters = SchemaCheck(
filter_dict,
Expand Down Expand Up @@ -555,14 +564,30 @@ def show_snapshots_singleton(
@click.option('--host', help='Elasticsearch host.')
@click.option('--url_prefix', help='Elasticsearch http url prefix.')
@click.option('--port', help='Elasticsearch port.')
@click.option('--use_ssl', is_flag=True, help='Connect to Elasticsearch through SSL.')
@click.option('--certificate', help='Path to certificate to use for SSL validation.')
@click.option('--client-cert', help='Path to file containing SSL certificate for client auth.', type=str)
@click.option('--client-key', help='Path to file containing SSL key for client auth.', type=str)
@click.option('--ssl-no-validate', help='Do not validate SSL certificate', is_flag=True)
@click.option(
'--use_ssl', is_flag=True, callback=false_to_none,
help='Connect to Elasticsearch through SSL.'
)
@click.option(
'--certificate', help='Path to certificate to use for SSL validation.')
@click.option(
'--client-cert',
help='Path to file containing SSL certificate for client auth.', type=str
)
@click.option(
'--client-key',
help='Path to file containing SSL key for client auth.', type=str
)
@click.option(
'--ssl-no-validate', is_flag=True, callback=false_to_none,
help='Do not validate SSL certificate'
)
@click.option('--http_auth', help='Use Basic Authentication ex: user:pass')
@click.option('--timeout', help='Connection timeout in seconds.', type=int)
@click.option('--master-only', is_flag=True, help='Only operate on elected master node.')
@click.option(
'--master-only', is_flag=True, callback=false_to_none,
help='Only operate on elected master node.'
)
@click.option('--dry-run', is_flag=True, help='Do not perform any changes.')
@click.option('--loglevel', help='Log level')
@click.option('--logfile', help='log file')
Expand Down
13 changes: 13 additions & 0 deletions docs/Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
Changelog
=========

4.2.1 (8 November 2016)
-----------------------

**Bug Fixes**

* In the course of package release testing, an undesirable scenario was
caught where boolean flags default values for ``curator_cli`` were
improperly overriding values from a yaml config file.

**General**

* Adding in direct download URLs for the RPM, DEB, tarball and zip packages.

4.2.0 (4 November 2016)
-----------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/asciidoc/index.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:curator_version: 4.2.0
:curator_version: 4.2.1
:curator_major: 4
:es_py_version: 2.4.0
:ref: http://www.elastic.co/guide/en/elasticsearch/reference/current
Expand Down
9 changes: 9 additions & 0 deletions docs/asciidoc/installation.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ Download and install the Public Signing Key:
wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
--------------------------------------------------

=== Direct Package Download Link

* https://packages.elastic.co/curator/{curator_major}/debian/pool/main/p/python/elasticsearch-curator_{curator_version}_amd64.deb[Elasticsearch Curator {curator_version} Binary Package (DEB)]

=== Repository Configuration

Add the following in your `/etc/apt/sources.list.d/` directory in a file with a
Expand Down Expand Up @@ -174,6 +178,11 @@ Download and install the public signing key:
rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
--------------------------------------------------

=== Direct Package Download Link

* https://packages.elastic.co/curator/{curator_major}/centos/6/Packages/elasticsearch-curator-{curator_version}-1.x86_64.rpm[Elasticsearch Curator {curator_version} RHEL/CentOS 6 Binary Package (RPM)]
* https://packages.elastic.co/curator/{curator_major}/centos/7/Packages/elasticsearch-curator-{curator_version}-1.x86_64.rpm[Elasticsearch Curator {curator_version} RHEL/CentOS 7 Binary Package (RPM)]

=== Repository Configuration

Add the following in your `/etc/yum.repos.d/` directory in a file with a `.repo`
Expand Down

0 comments on commit 0dc4595

Please sign in to comment.