本文整理汇总了Python中jenkins.Jenkins.get_info方法的典型用法代码示例。如果您正苦于以下问题:Python Jenkins.get_info方法的具体用法?Python Jenkins.get_info怎么用?Python Jenkins.get_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jenkins.Jenkins
的用法示例。
在下文中一共展示了Jenkins.get_info方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: connect
# 需要导入模块: from jenkins import Jenkins [as 别名]
# 或者: from jenkins.Jenkins import get_info [as 别名]
def connect(credentials):
"""
Since a user can have simple authentication with a single user/password or
define a set of IRC nick to Jenkin's users with API tokens, this helper
untangles this and returns a connection.
If no authentication is configured, just a connection is returned with no
authentication (probably read-only, depending on Jenkins settings)
"""
connection = Jenkins(
credentials['url'],
username=credentials['username'],
password=credentials['password'],
)
connection.password = credentials['password']
# try an actual request so we can bail if something is off
connection.get_info()
return connection
示例2: Jenkins
# 需要导入模块: from jenkins import Jenkins [as 别名]
# 或者: from jenkins.Jenkins import get_info [as 别名]
# coding: utf-8
__author__ = 'xP'
from jenkins import Jenkins
jenkins_object = Jenkins('http://127.0.0.1:8080')
print(jenkins_object.get_info())