netmonkey.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:netmonkey 作者: austind 项目源码 文件源码
def orion_init():
    """ Prompts for Orion credentials and returns a SwisClient object
    """
    global orion_server
    global orion_username
    global orion_password
    if not orion_username:
        default_username = getuser()
        orion_username = raw_input('Orion username [' + default_username + ']: ') or default_username
    if not orion_password:
        orion_password = getpass('Orion password: ')
    # SolarWinds-Orion is a special hostname in /etc/hosts
    # This was necessary to implement SSL checking
    # https://github.com/solarwinds/orionsdk-python#ssl-certificate-verification
    # this disables the SubjectAltNameWarning
    urllib3.disable_warnings()
    # TODO: Need a better/more resilient way of referencing server cert.
    return orionsdk.SwisClient('SolarWinds-Orion', orion_username, orion_password, verify='server.pem')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号