繁体   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