本文整理汇总了Python中jira.JIRA.current_user方法的典型用法代码示例。如果您正苦于以下问题:Python JIRA.current_user方法的具体用法?Python JIRA.current_user怎么用?Python JIRA.current_user使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jira.JIRA
的用法示例。
在下文中一共展示了JIRA.current_user方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: JiraTestManager
# 需要导入模块: from jira import JIRA [as 别名]
# 或者: from jira.JIRA import current_user [as 别名]
class JiraTestManager(object):
"""
Used to instantiate and populate the JIRA instance with data used by the unit tests.
Attributes:
CI_JIRA_ADMIN (str): Admin user account name.
CI_JIRA_USER (str): Limited user account name.
max_retries (int): number of retries to perform for recoverable HTTP errors.
"""
__shared_state = {}
def __init__(self):
self.__dict__ = self.__shared_state
if not self.__dict__:
self.initialized = 0
try:
if CI_JIRA_URL in os.environ:
self.CI_JIRA_URL = os.environ['CI_JIRA_URL']
self.max_retries = 5
else:
self.CI_JIRA_URL = "https://pycontribs.atlassian.net"
self.max_retries = 5
if CI_JIRA_ADMIN in os.environ:
self.CI_JIRA_ADMIN = os.environ['CI_JIRA_ADMIN']
else:
self.CI_JIRA_ADMIN = 'ci-admin'
if CI_JIRA_ADMIN_PASSWORD in os.environ:
self.CI_JIRA_ADMIN_PASSWORD = os.environ[
'CI_JIRA_ADMIN_PASSWORD']
else:
self.CI_JIRA_ADMIN_PASSWORD = 'sd4s3dgec5fhg4tfsds3434'
if 'CI_JIRA_USER' in os.environ:
self.CI_JIRA_USER = os.environ['CI_JIRA_USER']
else:
self.CI_JIRA_USER = 'ci-user'
if 'CI_JIRA_USER_PASSWORD' in os.environ:
self.CI_JIRA_USER_PASSWORD = os.environ[
'CI_JIRA_USER_PASSWORD']
else:
self.CI_JIRA_USER_PASSWORD = 'sd4s3dgec5fhg4tfsds3434'
self.CI_JIRA_ISSUE = os.environ.get('CI_JIRA_ISSUE', 'Bug')
if OAUTH:
self.jira_admin = JIRA(oauth={
'access_token': 'hTxcwsbUQiFuFALf7KZHDaeAJIo3tLUK',
'access_token_secret': 'aNCLQFP3ORNU6WY7HQISbqbhf0UudDAf',
'consumer_key': CONSUMER_KEY,
'key_cert': KEY_CERT_DATA})
else:
if self.CI_JIRA_ADMIN:
self.jira_admin = JIRA(self.CI_JIRA_URL, basic_auth=(self.CI_JIRA_ADMIN,
self.CI_JIRA_ADMIN_PASSWORD),
logging=False, validate=True, max_retries=self.max_retries)
else:
self.jira_admin = JIRA(self.CI_JIRA_URL, validate=True,
logging=False, max_retries=self.max_retries)
if self.jira_admin.current_user() != self.CI_JIRA_ADMIN:
# self.jira_admin.
self.initialized = 1
sys.exit(3)
if OAUTH:
self.jira_sysadmin = JIRA(oauth={
'access_token': '4ul1ETSFo7ybbIxAxzyRal39cTrwEGFv',
'access_token_secret':
'K83jBZnjnuVRcfjBflrKyThJa0KSjSs2',
'consumer_key': CONSUMER_KEY,
'key_cert': KEY_CERT_DATA}, logging=False, max_retries=self.max_retries)
else:
if self.CI_JIRA_ADMIN:
self.jira_sysadmin = JIRA(self.CI_JIRA_URL,
basic_auth=(self.CI_JIRA_ADMIN,
self.CI_JIRA_ADMIN_PASSWORD),
logging=False, validate=True, max_retries=self.max_retries)
else:
self.jira_sysadmin = JIRA(self.CI_JIRA_URL,
logging=False, max_retries=self.max_retries)
if OAUTH:
self.jira_normal = JIRA(oauth={
'access_token': 'ZVDgYDyIQqJY8IFlQ446jZaURIz5ECiB',
'access_token_secret':
'5WbLBybPDg1lqqyFjyXSCsCtAWTwz1eD',
'consumer_key': CONSUMER_KEY,
'key_cert': KEY_CERT_DATA})
else:
if self.CI_JIRA_ADMIN:
self.jira_normal = JIRA(self.CI_JIRA_URL,
basic_auth=(self.CI_JIRA_USER,
self.CI_JIRA_USER_PASSWORD),
validate=True, logging=False, max_retries=self.max_retries)
else:
self.jira_normal = JIRA(self.CI_JIRA_URL,
#.........这里部分代码省略.........