Fix SSL protocol references in mqtt module.

pull/63657/head
Matt Clay 5 years ago
parent 437e9b7063
commit 78eca0eb5d

@ -0,0 +1,2 @@
bugfixes:
- Fix SSL protcol references in the ``mqtt`` module to prevent failures on Python 2.6.

@ -142,10 +142,17 @@ from ansible.module_utils._text import to_native
#
def main():
tls_map = {
'tlsv1.2': ssl.PROTOCOL_TLSv1_2,
'tlsv1.1': ssl.PROTOCOL_TLSv1_1,
}
tls_map = {}
try:
tls_map['tlsv1.2'] = ssl.PROTOCOL_TLSv1_2
except AttributeError:
pass
try:
tls_map['tlsv1.1'] = ssl.PROTOCOL_TLSv1_1
except AttributeError:
pass
module = AnsibleModule(
argument_spec=dict(

Loading…
Cancel
Save