2017-09-11 5 views
0

ich nicht zu python-jira authentifizieren kann ich versuche ich https://pypi.python.org/pypi/jira/ zu verwenden Laut Dokumentation verwendenKann nicht an JIRA-api über python-jira lib verbinden

from jira import JIRA 

jira = JIRA('https://pm.maddevs.co/') # I am not sure if it is correct to use our site server or jiras 

username = 'my_user_name' 
password = 'my_pass' 
authed_jira = JIRA(basic_auth=(username, password)) 

Ich habe Fehler wie

WARNING:root:HTTPConnectionPool(host='localhost', port=2990): Max retries exceeded with url: /jira/rest/api/2/serverInfo (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f8a7e228198>: Failed to establish a new connection: [Errno 111] Connection refused',)) while doing GET http://localhost:2990/jira/rest/api/2/serverInfo [{'headers': {'X-Atlassian-Token': 'no-check', 'Content-Type': 'application/json', 'Accept-Encoding': 'gzip, deflate', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive', 'Accept': 'application/json,*.*;q=0.9', 'User-Agent': 'python-requests/2.18.4'}, 'params': None}] 
WARNING:root:Got ConnectionError [HTTPConnectionPool(host='localhost', port=2990): Max retries exceeded with url: /jira/rest/api/2/serverInfo (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f8a7e228198>: Failed to establish a new connection: [Errno 111] Connection refused',))] errno:None on GET http://localhost:2990/jira/rest/api/2/serverInfo 
{'response': None, 'request': <PreparedRequest [GET]>}\{'response': None, 'request': <PreparedRequest [GET]>} 
WARNING:root:Got recoverable error from GET http://localhost:2990/jira/rest/api/2/serverInfo, will retry [1/3] in 17.18299613314676s. Err: HTTPConnectionPool(host='localhost', port=2990): Max retries exceeded with url: /jira/rest/api/2/serverInfo (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f8a7e228198>: Failed to establish a new connection: [Errno 111] Connection refused',)) 

Antwort

1

sollten Sie das folgende Format verwenden, um Server zu verbinden:

jira = JIRA(basic_auth=(un, pwd), options={'server': server}) 

So wäre Ihr Code wie folgt:

from jira import JIRA 

username = 'my_user_name' 
password = 'my_pass' 
jira = JIRA(basic_auth=(username, password), options = {'server': 'https://pm.maddevs.co/'}) 
Verwandte Themen