mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
Fix rabbitmq modules for python3 import
Also get rid of unnecessary capture of exception into a variable for python-2.4 compat.
This commit is contained in:
parent
441376c754
commit
8894c57753
3 changed files with 18 additions and 16 deletions
|
@ -120,14 +120,15 @@ EXAMPLES = '''
|
|||
'''
|
||||
|
||||
import json
|
||||
|
||||
try:
|
||||
import requests
|
||||
HAS_REQUESTS = True
|
||||
except ImportError as e:
|
||||
except ImportError:
|
||||
HAS_REQUESTS = False
|
||||
import urllib
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.six.moves.urllib import parse as urllib_parse
|
||||
|
||||
|
||||
def main():
|
||||
|
@ -155,7 +156,7 @@ def main():
|
|||
url = "http://%s:%s/api/queues/%s/%s" % (
|
||||
module.params['login_host'],
|
||||
module.params['login_port'],
|
||||
urllib.quote(module.params['vhost'],''),
|
||||
urllib_parse.quote(module.params['vhost'],''),
|
||||
module.params['name']
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue