本文整理汇总了Python中tactic_client_lib.TacticServerStub.set_ticket方法的典型用法代码示例。如果您正苦于以下问题:Python TacticServerStub.set_ticket方法的具体用法?Python TacticServerStub.set_ticket怎么用?Python TacticServerStub.set_ticket使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tactic_client_lib.TacticServerStub
的用法示例。
在下文中一共展示了TacticServerStub.set_ticket方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: from tactic_client_lib import TacticServerStub [as 别名]
# 或者: from tactic_client_lib.TacticServerStub import set_ticket [as 别名]
def execute(my):
#protocol = 'xmlrpc'
protocol = 'local'
if protocol == 'local':
server = TacticServerStub.get()
else:
server = TacticServerStub(protocol=protocol,setup=False)
TacticServerStub.set(server)
project = my.data.get("project")
ticket = my.data.get("ticket")
assert project
assert ticket
server.set_server("localhost")
server.set_project(project)
server.set_ticket(ticket)
my.class_name = my.data.get('class_name')
assert my.class_name
my.kwargs = my.data.get('kwargs')
if not my.kwargs:
my.kwags = {}
#trigger = eval("%s(**my.kwargs)" % my.class_name)
trigger = Common.create_from_class_path(my.class_name, kwargs=my.kwargs)
input_data = my.get_input_data()
trigger.set_input(input_data)
trigger.execute()
示例2: get_server
# 需要导入模块: from tactic_client_lib import TacticServerStub [as 别名]
# 或者: from tactic_client_lib.TacticServerStub import set_ticket [as 别名]
def get_server(my):
# do a query for the search
from tactic_client_lib import TacticServerStub
if my.protocol == 'xmlrpc':
stub = TacticServerStub(setup=False, protocol=my.protocol)
stub.set_server(my.host)
stub.set_project(my.project_code)
stub.set_ticket(my.ticket)
else:
stub = TacticServerStub.get()
return stub
示例3: BaseClientCbk
# 需要导入模块: from tactic_client_lib import TacticServerStub [as 别名]
# 或者: from tactic_client_lib.TacticServerStub import set_ticket [as 别名]
class BaseClientCbk(object):
def set_ticket(self, ticket):
self.ticket = ticket
def set_options(self, options):
self.options = options
def get_option(self, name):
return self.options.get(name)
def _execute(self):
# get the server name
server_name = self.get_option("server_name")
if not server_name:
raise ClientCallbackException("No [server_name] option delivered to callback")
server_name = server_name[0]
# get the project
project_code = self.get_option("project_code")
if not project_code:
raise ClientCallbackException("No [project_code] option delivered to callback")
project_code = project_code[0]
# the entire pipeline is run in a TacticServer Transaction
from tactic_client_lib import TacticServerStub
self.server = TacticServerStub()
self.server.set_server(server_name)
self.server.set_ticket(self.ticket)
self.server.set_project(project_code)
self.server.start("Pipeline checkin")
try:
self.execute()
except Exception, e:
self.server.abort()
raise
else:
示例4: TacticServerStub
# 需要导入模块: from tactic_client_lib import TacticServerStub [as 别名]
# 或者: from tactic_client_lib.TacticServerStub import set_ticket [as 别名]
import tacticenv
from tactic_client_lib import TacticServerStub
server = TacticServerStub(protocol="xmlrpc")
#server.set_project("sample3d")
server.set_ticket("60128265ebea63620de1f5b0ffc502eb")
search_type = "prod/shot"
server.start(title='cow')
sobject = server.insert(search_type, { 'description': 'wow'} )
server.update(search_key, { 'description': 'another update'} )
server.finish()
sobject = server.insert(search_type, { 'description': 'wow2'} )
sobject = server.insert(search_type, { 'description': 'wow3'} )
示例5: execute
# 需要导入模块: from tactic_client_lib import TacticServerStub [as 别名]
# 或者: from tactic_client_lib.TacticServerStub import set_ticket [as 别名]
def execute(self):
#protocol = 'xmlrpc'
protocol = 'local'
if protocol == 'local':
server = TacticServerStub.get()
else:
server = TacticServerStub(protocol=protocol,setup=False)
TacticServerStub.set(server)
project = self.data.get("project")
ticket = self.data.get("ticket")
assert project
assert ticket
server.set_server("localhost")
server.set_project(project)
server.set_ticket(ticket)
self.class_name = self.data.get('class_name')
assert self.class_name
self.kwargs = self.data.get('kwargs')
if not self.kwargs:
self.kwags = {}
#trigger = eval("%s(**self.kwargs)" % self.class_name)
trigger = Common.create_from_class_path(self.class_name, kwargs=self.kwargs)
input_data = self.get_input_data()
trigger.set_input(input_data)
try:
trigger.execute()
info = trigger.get_info()
result = info.get("result")
if result is not None:
# map booleans to a message
if result in ['true', True]:
result = 'complete'
elif result in ['false', False]:
result = 'revise'
self.set_pipeline_status(result)
self.info['result'] = result
else:
self.set_pipeline_status("complete")
self.info['result'] = "complete"
except Exception as e:
#self.set_pipeline_status("error", {"error": str(e)})
self.set_pipeline_status("revise", {"error": str(e)})
import sys,traceback
print("Error: ", e)
# print the stacktrace
tb = sys.exc_info()[2]
stacktrace = traceback.format_tb(tb)
stacktrace_str = "".join(stacktrace)
print("-"*50)
print(stacktrace_str)
print(str(e))
print("-"*50)
self.info['result'] = "error"
self.info['message'] = str(e)