@@ -35,21 +35,6 @@ def deserialize(self, proc_file, restart=False):
3535
3636 if not proc_list : raise ValueError ('No information read from process list file' )
3737
38- i = 0
39- header = ''
40-
41- while not header :
42- header = proc_list [i ].strip ()
43- i += 1
44-
45- if header [0 ] != '#' :
46- raise RuntimeError ('Missing execution mode header in process list file. Must have at minimum:\n #SHELL\n or\n #PYTHON' )
47-
48- mode = header [1 :].split ('|' )[0 ]
49-
50- if mode not in [ constants .MODE_SHELL , constants .MODE_PYTHON ]:
51- raise RuntimeError ('Incorrect execution mode in header: {}' .format (mode ))
52-
5338 used_ids = set ()
5439
5540 for proc in proc_list :
@@ -85,62 +70,33 @@ def deserialize(self, proc_file, restart=False):
8570
8671 dependencies = [ int (x ) for x in sub_details [1 ].split (',' ) ]
8772
88- if mode == constants .MODE_SHELL :
89- if restart :
90- register .add_node (
91- id = id ,
92- dependencies = dependencies ,
93- max_attempts = sub_details [2 ],
94- retry_wait_time = sub_details [3 ],
95- status = sub_details [4 ] if sub_details [4 ] in [ constants .STATUS_COMPLETED , constants .STATUS_NORUN ] else constants .STATUS_PENDING ,
96- name = sub_details [6 ],
97- module = 'pyrunner' ,
98- worker = 'ShellWorker' ,
99- arguments = [sub_details [7 ]],
100- logfile = sub_details [8 ] if len (sub_details ) > 8 else None ,
101- named_deps = False
102- )
103- else :
104- register .add_node (
105- id = id ,
106- dependencies = dependencies ,
107- max_attempts = sub_details [2 ],
108- retry_wait_time = sub_details [3 ],
109- name = sub_details [4 ],
110- module = 'pyrunner' ,
111- worker = 'ShellWorker' ,
112- arguments = [sub_details [5 ]],
113- logfile = sub_details [6 ] if len (sub_details ) > 6 else None ,
114- named_deps = False
115- )
73+ if restart :
74+ register .add_node (
75+ id = id ,
76+ dependencies = dependencies ,
77+ max_attempts = sub_details [2 ],
78+ retry_wait_time = sub_details [3 ],
79+ status = sub_details [4 ] if sub_details [4 ] in [ constants .STATUS_COMPLETED , constants .STATUS_NORUN ] else constants .STATUS_PENDING ,
80+ name = sub_details [6 ],
81+ module = sub_details [7 ],
82+ worker = sub_details [8 ],
83+ arguments = [ s .strip ('"' ) if s .strip ().startswith ('"' ) and s .strip ().endswith ('"' ) else s .strip () for s in comma_pattern .split (sub_details [9 ])[1 ::2 ] ] if len (sub_details ) > 9 else None ,
84+ logfile = sub_details [10 ] if len (sub_details ) > 10 else None ,
85+ named_deps = False
86+ )
11687 else :
117- if restart :
118- register .add_node (
119- id = id ,
120- dependencies = dependencies ,
121- max_attempts = sub_details [2 ],
122- retry_wait_time = sub_details [3 ],
123- status = sub_details [4 ] if sub_details [4 ] in [ constants .STATUS_COMPLETED , constants .STATUS_NORUN ] else constants .STATUS_PENDING ,
124- name = sub_details [6 ],
125- module = sub_details [7 ],
126- worker = sub_details [8 ],
127- arguments = [ s .strip ('"' ) if s .strip ().startswith ('"' ) and s .strip ().endswith ('"' ) else s .strip () for s in comma_pattern .split (sub_details [9 ])[1 ::2 ] ] if len (sub_details ) > 9 else None ,
128- logfile = sub_details [10 ] if len (sub_details ) > 10 else None ,
129- named_deps = False
130- )
131- else :
132- register .add_node (
133- id = id ,
134- dependencies = dependencies ,
135- max_attempts = sub_details [2 ],
136- retry_wait_time = sub_details [3 ],
137- name = sub_details [4 ],
138- module = sub_details [5 ],
139- worker = sub_details [6 ],
140- arguments = [ s .strip ('"' ) if s .strip ().startswith ('"' ) and s .strip ().endswith ('"' ) else s .strip () for s in comma_pattern .split (sub_details [7 ])[1 ::2 ] ] if len (sub_details ) > 7 else None ,
141- logfile = sub_details [8 ] if len (sub_details ) > 8 else None ,
142- named_deps = False
143- )
88+ register .add_node (
89+ id = id ,
90+ dependencies = dependencies ,
91+ max_attempts = sub_details [2 ],
92+ retry_wait_time = sub_details [3 ],
93+ name = sub_details [4 ],
94+ module = sub_details [5 ],
95+ worker = sub_details [6 ],
96+ arguments = [ s .strip ('"' ) if s .strip ().startswith ('"' ) and s .strip ().endswith ('"' ) else s .strip () for s in comma_pattern .split (sub_details [7 ])[1 ::2 ] ] if len (sub_details ) > 7 else None ,
97+ logfile = sub_details [8 ] if len (sub_details ) > 8 else None ,
98+ named_deps = False
99+ )
144100
145101 return register
146102
0 commit comments