|
|
@ -247,6 +247,7 @@ from ansible.module_utils.basic import *
|
|
|
|
from ansible.module_utils.urls import *
|
|
|
|
from ansible.module_utils.urls import *
|
|
|
|
from ansible.module_utils.pycompat24 import get_exception
|
|
|
|
from ansible.module_utils.pycompat24 import get_exception
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def request(url, user, passwd, timeout, data=None, method=None):
|
|
|
|
def request(url, user, passwd, timeout, data=None, method=None):
|
|
|
|
if data:
|
|
|
|
if data:
|
|
|
|
data = json.dumps(data)
|
|
|
|
data = json.dumps(data)
|
|
|
@ -273,12 +274,15 @@ def request(url, user, passwd, timeout, data=None, method=None):
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
return {}
|
|
|
|
return {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def post(url, user, passwd, timeout, data):
|
|
|
|
def post(url, user, passwd, timeout, data):
|
|
|
|
return request(url, user, passwd, timeout, data=data, method='POST')
|
|
|
|
return request(url, user, passwd, timeout, data=data, method='POST')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def put(url, user, passwd, timeout, data):
|
|
|
|
def put(url, user, passwd, timeout, data):
|
|
|
|
return request(url, user, passwd, timeout, data=data, method='PUT')
|
|
|
|
return request(url, user, passwd, timeout, data=data, method='PUT')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get(url, user, passwd, timeout):
|
|
|
|
def get(url, user, passwd, timeout):
|
|
|
|
return request(url, user, passwd, timeout)
|
|
|
|
return request(url, user, passwd, timeout)
|
|
|
|
|
|
|
|
|
|
|
@ -357,6 +361,7 @@ def transition(restbase, user, passwd, params):
|
|
|
|
|
|
|
|
|
|
|
|
return ret
|
|
|
|
return ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def link(restbase, user, passwd, params):
|
|
|
|
def link(restbase, user, passwd, params):
|
|
|
|
data = {
|
|
|
|
data = {
|
|
|
|
'type': {'name': params['linktype']},
|
|
|
|
'type': {'name': params['linktype']},
|
|
|
@ -378,6 +383,7 @@ OP_REQUIRED = dict(create=['project', 'issuetype', 'summary', 'description'],
|
|
|
|
transition=['status'],
|
|
|
|
transition=['status'],
|
|
|
|
link=['linktype', 'inwardissue', 'outwardissue'])
|
|
|
|
link=['linktype', 'inwardissue', 'outwardissue'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
def main():
|
|
|
|
|
|
|
|
|
|
|
|
global module
|
|
|
|
global module
|
|
|
@ -440,7 +446,6 @@ def main():
|
|
|
|
e = get_exception()
|
|
|
|
e = get_exception()
|
|
|
|
return module.fail_json(msg=e.message)
|
|
|
|
return module.fail_json(msg=e.message)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.exit_json(changed=True, meta=ret)
|
|
|
|
module.exit_json(changed=True, meta=ret)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|