mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #7536 from fly/linode-warn-ssl
warn if remote SSL cert is not checked in linode
This commit is contained in:
commit
ba641de69e
1 changed files with 9 additions and 4 deletions
|
@ -88,7 +88,7 @@ options:
|
||||||
description:
|
description:
|
||||||
- how long before wait gives up, in seconds
|
- how long before wait gives up, in seconds
|
||||||
default: 300
|
default: 300
|
||||||
requirements: [ "linode-python" ]
|
requirements: [ "linode-python", "pycurl" ]
|
||||||
author: Vincent Viallet
|
author: Vincent Viallet
|
||||||
notes:
|
notes:
|
||||||
- LINODE_API_KEY env variable can be used instead
|
- LINODE_API_KEY env variable can be used instead
|
||||||
|
@ -156,14 +156,19 @@ import time
|
||||||
import os
|
import os
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# linode module raise warning due to ssl - silently ignore them ...
|
import pycurl
|
||||||
import warnings
|
except ImportError:
|
||||||
warnings.simplefilter("ignore")
|
print("failed=True msg='pycurl required for this module'")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
from linode import api as linode_api
|
from linode import api as linode_api
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print("failed=True msg='linode-python required for this module'")
|
print("failed=True msg='linode-python required for this module'")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def randompass():
|
def randompass():
|
||||||
'''
|
'''
|
||||||
Generate a long random password that comply to Linode requirements
|
Generate a long random password that comply to Linode requirements
|
||||||
|
|
Loading…
Reference in a new issue