当我通过python (pyral)连接到Rally时,我会收到以下警告。
C:\PYTHON27\lib\site-packages\requests-2.6.0-py2.7.egg\requests\packages\urllib3\util\ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning
然而,其余的都很好,但是每次发出这样的警告还是有点烦人的。
对如何解决连接“问题”或隐藏警告有什么想法吗?
我使用的代码如下:
#!/usr/bin/env python
from pyral import Rally, rallySettings, RallyRESTAPIError
#####################################
### CONNECTION TO RALLY ###
#####################################
#Configuration parameters
my_server = rally1.rallydev.com
my_user = "hello@world.com"
my_password = "toto"
my_workspace = "Sandbox"
my_project = "My Project"
#Connect to Rally
try:
rally = Rally(my_server, my_user, my_password, workspace=my_workspace, project=my_project)
except RallyRESTAPIError, details:
sys.stderr.write('ERROR: %s \n\n' % details)
rally.enableLogging('rally.simple-use.log')
print "\n"发布于 2015-05-07 11:08:05
这个解决方案一直摆在我眼前(谢谢阿巴纳特!)
只需加上:
import logging
logging.basicConfig(filename='Rally.log',level=logging.NOTSET)
logging.captureWarnings(True)https://stackoverflow.com/questions/30098960
复制相似问题