簡體   English   中英

使用Python-Jira在JIRA上獲取錯誤狀態

[英]Fetch bug status on JIRA using Python-Jira

我正在嘗試編寫腳本以獲取JIRA上的錯誤狀態,

import jira.client
from jira.client import JIRA

options = {'server': 'https://<url>:<port>/', 'verify': 'path/to/id_rsa.pub'}
jira = JIRA(options, basic_auth=('username', 'pswd'))

但是收到以下警告消息並且無法連接:

bash-4.2$ python try_jira.py
WARNING:root:unknown error (_ssl.c:2747) while doing GET https://spg-jira.xpliant.com:8443/rest/api/2/serverInfo [{u'headers': {'Accept-Encoding': 'gzip, deflate', u'Accept': u'application/json,*.*;q=0.9', 'User-Agent': 'python-requests/2.17.3', 'Connection': 'keep-alive', u'X-Atlassian-Token': u'no-check', u'Cache-Control': u'no-cache', u'Content-Type': u'application/json'}, 'params': None}]
WARNING:root:Got ConnectionError [unknown error (_ssl.c:2747)] errno:None on GET https://spg-jira.xpliant.com:8443/rest/api/2/serverInfo
{'request': <PreparedRequest [GET]>, 'response': None}\{'request': <PreparedRequest [GET]>, 'response': None}
WARNING:root:Got recoverable error from GET https://spg-jira.xpliant.com:8443/rest/api/2/serverInfo, will retry [1/3] in 7.55620272034s. Err: unknown error (_ssl.c:2747)
WARNING:root:unknown error (_ssl.c:2747) while doing GET https://spg-jira.xpliant.com:8443/rest/api/2/serverInfo [{u'headers': {'Accept-Encoding': 'gzip, deflate', u'Accept': u'application/json,*.*;q=0.9', 'User-Agent': 'python-requests/2.17.3', 'Connection': 'keep-alive', u'X-Atlassian-Token': u'no-check', u'Cache-Control': u'no-cache', u'Content-Type': u'application/json'}, 'params': None}]
WARNING:root:Got ConnectionError [unknown error (_ssl.c:2747)] errno:None on GET https://spg-jira.xpliant.com:8443/rest/api/2/serverInfo
{'request': <PreparedRequest [GET]>, 'response': None}\{'request': <PreparedRequest [GET]>, 'response': None}
WARNING:root:Got recoverable error from GET https://spg-jira.xpliant.com:8443/rest/api/2/serverInfo, will retry [2/3] in 8.41708571146s. Err: unknown error (_ssl.c:2747)
WARNING:root:unknown error (_ssl.c:2747) while doing GET https://spg-jira.xpliant.com:8443/rest/api/2/serverInfo [{u'headers': {'Accept-Encoding': 'gzip, deflate', u'Accept': u'application/json,*.*;q=0.9', 'User-Agent': 'python-requests/2.17.3', 'Connection': 'keep-alive', u'X-Atlassian-Token': u'no-check', u'Cache-Control': u'no-cache', u'Content-Type': u'application/json'}, 'params': None}]
WARNING:root:Got ConnectionError [unknown error (_ssl.c:2747)] errno:None on GET https://spg-jira.xpliant.com:8443/rest/api/2/serverInfo
{'request': <PreparedRequest [GET]>, 'response': None}\{'request': <PreparedRequest [GET]>, 'response': None}
WARNING:root:Got recoverable error from GET https://spg-jira.xpliant.com:8443/rest/api/2/serverInfo, will retry [3/3] in 39.7347032392s. Err: unknown error (_ssl.c:2747)

如果我在選項中保留'verify' : False ,我會看到以下消息:

bash-4.2$ python try_jira.py
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:852: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:852: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:852: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)

有人可以幫我弄清楚我是否在這里遺漏了什么嗎?

文檔說:

強烈建議不要進行未經驗證的HTTPS請求,但是,如果您了解風險並希望禁用這些警告,則可以使用disable_warnings():

>>> import urllib3
>>> urllib3.disable_warnings()

因此,如果您了解其中的含義,則可以在代碼中放入disable_warnings調用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM