mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
be explicit about urllib import and remove conditional urllib(2) import
urllib and urllib2 have been in the python stdlib since at least python-2.3. There's no reason to conditionalize it. Fixes https://github.com/ansible/ansible/issues/11322
This commit is contained in:
parent
655fa27dc7
commit
16bd2c7357
11 changed files with 23 additions and 20 deletions
|
@ -85,8 +85,7 @@ options:
|
|||
choices: ['yes', 'no']
|
||||
version_added: 1.5.1
|
||||
|
||||
# informational: requirements for nodes
|
||||
requirements: [ urllib, urllib2 ]
|
||||
requirements: [ ]
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
|
@ -104,6 +103,8 @@ EXAMPLES = '''
|
|||
tags=tag1,tag2,tag3
|
||||
'''
|
||||
|
||||
import urllib
|
||||
|
||||
# ===========================================
|
||||
# Module execution.
|
||||
#
|
||||
|
|
|
@ -49,6 +49,8 @@ EXAMPLES = '''
|
|||
message=deployed {{ target }}
|
||||
'''
|
||||
|
||||
import urllib
|
||||
|
||||
BASE_URL = 'https://grove.io/api/notice/%s/'
|
||||
|
||||
# ==============================================================
|
||||
|
|
|
@ -62,8 +62,7 @@ options:
|
|||
version_added: 1.6.0
|
||||
|
||||
|
||||
# informational: requirements for nodes
|
||||
requirements: [ urllib, urllib2 ]
|
||||
requirements: [ ]
|
||||
author: "WAKAYAMA Shirou (@shirou), BOURDEL Paul (@pb8226)"
|
||||
'''
|
||||
|
||||
|
@ -76,6 +75,7 @@ EXAMPLES = '''
|
|||
#
|
||||
|
||||
MSG_URI = "https://api.hipchat.com/v1/rooms/message"
|
||||
import urllib
|
||||
|
||||
def send_msg(module, token, room, msg_from, msg, msg_format='text',
|
||||
color='yellow', notify=False, api=MSG_URI):
|
||||
|
|
|
@ -71,6 +71,7 @@ EXAMPLES = """
|
|||
msg: "{{ inventory_hostname }} completed"
|
||||
"""
|
||||
|
||||
import urllib
|
||||
|
||||
NEXMO_API = 'https://rest.nexmo.com/sms/json'
|
||||
|
||||
|
|
|
@ -84,10 +84,7 @@ EXAMPLES = '''
|
|||
# =======================================
|
||||
# sendgrid module support methods
|
||||
#
|
||||
try:
|
||||
import urllib, urllib2
|
||||
except ImportError:
|
||||
module.fail_json(msg="urllib and urllib2 are required")
|
||||
import urllib, urllib2
|
||||
|
||||
import base64
|
||||
|
||||
|
|
|
@ -104,10 +104,7 @@ EXAMPLES = '''
|
|||
# =======================================
|
||||
# twilio module support methods
|
||||
#
|
||||
try:
|
||||
import urllib, urllib2
|
||||
except ImportError:
|
||||
module.fail_json(msg="urllib and urllib2 are required")
|
||||
import urllib, urllib2
|
||||
|
||||
import base64
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue