Skip to content

Commit

Permalink
Merge pull request #820 from untergeek/release/4.2.3
Browse files Browse the repository at this point in the history
Release/4.2.3
  • Loading branch information
untergeek committed Nov 22, 2016
2 parents 04350eb + 8197f23 commit 9bb4a87
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 35 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.2'
__version__ = '4.2.3'
20 changes: 9 additions & 11 deletions curator/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,19 +526,17 @@ def get_client(**kwargs):
kwargs['verify_certs'] = True
kwargs['ca_certs'] = kwargs['certificate']
else: # Try to use bundled certifi certificates
bundled_path = (
'/opt/elasticsearch-curator/lib/certifi/cacert.pem'
)
if os.path.isfile(bundled_path):
if getattr(sys, 'frozen', False):
# The application is frozen (compiled)
datadir = os.path.dirname(sys.executable)
kwargs['verify_certs'] = True
kwargs['ca_certs'] = bundled_path
kwargs['ca_certs'] = os.path.join(datadir, 'cacert.pem')
else:
try: # Try to use certifi certificates via certifi.where():
import certifi
kwargs['verify_certs'] = True
kwargs['ca_certs'] = certifi.where()
except ImportError:
logger.warn('Unable to verify SSL certificate.')
# Use certifi certificates via certifi.where():
import certifi
kwargs['verify_certs'] = True
kwargs['ca_certs'] = certifi.where()

try:
from requests_aws4auth import AWS4Auth
kwargs['aws_key'] = False if not 'aws_key' in kwargs \
Expand Down
16 changes: 16 additions & 0 deletions docs/Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
Changelog
=========

4.2.3 (21 November 2016)
------------------------

4.2.2 was pulled immediately after release after it was discovered that the
Windows binary distributions were still not including the certifi-provided
certificates. This has now been remedied.

**General**

* ``certifi`` is now officially a requirement.
* ``setup.py`` now forcibly includes the ``certifi`` certificate PEM file in
the "frozen" distributions (i.e., the compiled versions). The
``get_client`` method was updated to reflect this and catch it for both the
Linux and Windows binary distributions. This should `finally` put to rest
#810

4.2.2 (21 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.2
:curator_version: 4.2.3
:curator_major: 4
:es_py_version: 2.4.0
:ref: http://www.elastic.co/guide/en/elasticsearch/reference/current
Expand Down
19 changes: 9 additions & 10 deletions docs/asciidoc/installation.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,15 @@ or uncompress and run `python setup.py install`

 

=== certifi
Download and install the `certifi` dependency. Always use the most recent
version:

. `wget https://github.com/certifi/python-certifi/archive/2016.09.26.tar.gz -O certifi.tar.gz`
. `pip install certifi.tar.gz`

 

=== PyYAML
Download and install the http://pyyaml.org/wiki/PyYAML/[PyYAML] dependency (3.10
or greater):
Expand Down Expand Up @@ -389,13 +398,3 @@ Download and install Curator:

or uncompress and run `python setup.py install`. At this point you could also
run `run_curator.py` from the source directory as well.

=== Optional additional module(s)

The following module(s) provide some additional features, but are not required
for basic functionality.

For each of these, installation follows the same pattern as above:

* https://github.com/certifi/python-certifi/archive/2016.09.26.tar.gz[certifi]
provides SSL certificate validation for most major signing organizations.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ elasticsearch>=2.4.0,<3.0.0
click>=6.0
pyyaml>=3.10
voluptuous>=0.9.3
certifi>=2016.09.26
10 changes: 9 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
import re
import sys
from setuptools import setup
import certifi

cert_file = certifi.where()

# Utility function to read from file.
def fread(fname):
Expand All @@ -26,14 +29,19 @@ def get_install_requires():
res.append('click>=6.0')
res.append('pyyaml>=3.10')
res.append('voluptuous>=0.9.3')
res.append('certifi>=2016.09.26')
return res

try:
### cx_Freeze ###
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need
# fine tuning.
buildOptions = dict(packages = [], excludes = [])
buildOptions = dict(
packages = [],
excludes = [],
include_files = [cert_file],
)

base = 'Console'

Expand Down
5 changes: 0 additions & 5 deletions unix_packages/build_official_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,10 @@ mkdir -p ${PACKAGEDIR}
cd curator-${1}
${PIPBIN} install -U --user setuptools
${PIPBIN} install -U --user requests_aws4auth
${PIPBIN} install -U --user certifi
${PIPBIN} install -U --user -r requirements.txt
${PYBIN} setup.py build_exe
sudo mv build/exe.linux-x86_64-${PYVER} /opt/elasticsearch-curator

# Put a copy of the up-to-date certifi cacert.pem into a reachable place for the binary
sudo mkdir -p /opt/elasticsearch-curator/lib/certifi
sudo cp /home/vagrant/.local/lib/python3.5/site-packages/certifi/cacert.pem /opt/elasticsearch-curator/lib/certifi

sudo chown -R root:root /opt/elasticsearch-curator
cd ..
fpm \
Expand Down
6 changes: 0 additions & 6 deletions unix_packages/build_package_from_source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,10 @@ cd $SOURCE_DIR
mkdir -p ${PACKAGEDIR}
${PIPBIN} install -U --user setuptools
${PIPBIN} install -U --user requests_aws4auth
${PIPBIN} install -U --user certifi
${PIPBIN} install -U --user -r requirements.txt
${PYBIN} setup.py build_exe
sudo mv build/exe.linux-x86_64-${PYVER} /opt/elasticsearch-curator

# Put a copy of the up-to-date certifi cacert.pem into a reachable place for the binary
PEMTARGET='/opt/elasticsearch-curator/lib/certifi'
sudo mkdir -p ${PEMTARGET}
sudo cp /home/vagrant/.local/lib/python3.5/site-packages/certifi/cacert.pem ${PEMTARGET}

sudo chown -R root:root /opt/elasticsearch-curator
cd $WORKDIR
fpm \
Expand Down

0 comments on commit 9bb4a87

Please sign in to comment.