-
Notifications
You must be signed in to change notification settings - Fork 3
/
newsampleclient.py
38 lines (34 loc) · 1.43 KB
/
newsampleclient.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
__author__ = '[email protected]'
import time
import os
from wfmng import *
from auth import getAuthTicket
import random
user = ''
passwd = ''
tavernaServerCloudId = "404"
ticket = getAuthTicket( user, passwd )
print "=== createTavernaServerWorkflow"
eid = random.randint(90000, 100000)
abs_path = os.path.abspath(os.path.dirname(__file__))
wf_definition = open(os.path.join(abs_path, 'SimpleWorkflow.t2flow'), 'r').read()
input_definition = open(os.path.join(abs_path, 'SimpleWorkflowInputs.xml'), 'r').read()
workflow_worker_built_failed = True
#while workflow_worker_built_failed:
ret = execute_workflow(ticket, eid, "Execution Test %s" % str(eid), tavernaServerCloudId, wf_definition, input_definition, submitionWorkAround=True)
if ret=="False":
print "=== some errors occurs"
info = getWorkflowInformation(eid, ticket)
print info
while info and info['status'] != 'Finished' and info['error'] != True:
print "=== sleeping for 5..."
time.sleep(5)
print "=== getWorkflowInformation"
info = getWorkflowInformation(eid, ticket)
print info
deleteExecution(eid, ticket)
print "=== Workflow execution deleted from WM"
#workflow_worker_built_failed = (info['error'] == True) and (info['error_msg']=="Submitting workflow failed failed to build workflow run worker")
#if workflow_worker_built_failed:
# print "=== Failed to build workflow run worker, retrying ..."
# ticket = getAuthTicket( user, passwd ) # renew ticket before retrying