ansible/lib/ansible
guoqiao 6ef9c2d7b7 Fix mail module for python 3.7.0 (#44550) (#44552)
In python 3.7.0, changes in `ssl.py` breaks `smtplib.SMTP_SSL`, which
then breaks `mail` module in ansible.

Run this line in python shell:

    import smtplib;smtplib.SMTP_SSL().connect(host='smtp.gmail.com', port=465)

Before python 3.7.0, we will get:

    (220, b'smtp.gmail.com ESMTP j13-v6sm3086685pgq.56 - gsmtp')

In python 3.7.0, we get such error at `lib/python3.7/ssl.py` line 843, method `_create`:

    ValueError: server_hostname cannot be an empty string or start with a leading dot.

The ssl module is using host info on SMTP_SSL instance, which is not set.
The fix/workaround is simple, just pass host info to it:

    import smtplib;smtplib.SMTP_SSL(host='smtp.gmail.com').connect(host='smtp.gmail.com', port=465)

Fixes: #44550

Signed-off-by: Guo Qiao <guoqiao@gmail.com>
2018-08-23 16:50:54 +10:00
..
cli Remove deprecated tags config option (#44479) 2018-08-21 14:57:06 -05:00
compat Fix the local and ssh plugins for a cornercase retrying a syscall 2018-08-13 07:17:11 -07:00
config Extend module_defaults by adding default groups for cloud modules (#44127) 2018-08-22 21:33:27 -04:00
errors
executor Extend module_defaults by adding default groups for cloud modules (#44127) 2018-08-22 21:33:27 -04:00
galaxy Fix invalid Dockerfile created by "galaxy init --type apb" (#42017) 2018-07-17 08:11:42 +05:30
inventory Error on empty group/host name (#42584) 2018-07-12 09:59:00 -04:00
module_utils basic.py: catch ValueError when trying to import hash algorithms (#44551) 2018-08-22 23:34:50 -07:00
modules Fix mail module for python 3.7.0 (#44550) (#44552) 2018-08-23 16:50:54 +10:00
parsing Raise a nicer error when we cannot execute the editor (#44423) 2018-08-22 10:24:11 -05:00
playbook Mass nuke deprecated items that are easily removed. ci_complete (#44320) 2018-08-20 16:26:10 -05:00
plugins Added Support for excluding IPs in nios_next_ip and created new pluggin for nios_next_network (#44437) 2018-08-23 03:08:39 +00:00
template Add specific exceptions to except 2018-08-01 16:42:05 -04:00
utils Update netconf_config module (#44379) 2018-08-21 20:41:18 +05:30
vars Don't use copy.deepcopy in high workload areas, use naive_deepcopy (#44337) 2018-08-20 15:08:29 -05:00
__init__.py
constants.py We can create a frozenset from a tuple 2018-08-13 15:21:44 -07:00
release.py