@@ -210,6 +210,7 @@ def create_pool(batch_service_client, pool_id):
210
210
elevation_level = batchmodels .ElevationLevel .admin )),
211
211
)
212
212
)
213
+
213
214
batch_service_client .pool .add (new_pool )
214
215
215
216
def create_job (batch_service_client , job_id , pool_id ):
@@ -224,8 +225,8 @@ def create_job(batch_service_client, job_id, pool_id):
224
225
print ('Creating job [{}]...' .format (job_id ))
225
226
226
227
job = batch .models .JobAddParameter (
227
- job_id ,
228
- batch .models .PoolInformation (pool_id = pool_id ))
228
+ id = job_id ,
229
+ pool_info = batch .models .PoolInformation (pool_id = pool_id ))
229
230
230
231
batch_service_client .job .add (job )
231
232
@@ -254,11 +255,13 @@ def add_tasks(batch_service_client, job_id, input_files, output_container_sas_ur
254
255
id = 'Task{}' .format (idx ),
255
256
command_line = command ,
256
257
resource_files = [input_file ],
257
- output_files = [batchmodels .OutputFile (output_file_path ,
258
+ output_files = [batchmodels .OutputFile (
259
+ file_pattern = output_file_path ,
258
260
destination = batchmodels .OutputFileDestination (
259
- container = batchmodels .OutputFileBlobContainerDestination (output_container_sas_url )),
261
+ container = batchmodels .OutputFileBlobContainerDestination (
262
+ container_url = output_container_sas_url )),
260
263
upload_options = batchmodels .OutputFileUploadOptions (
261
- batchmodels .OutputFileUploadCondition .task_success ))]
264
+ upload_condition = batchmodels .OutputFileUploadCondition .task_success ))]
262
265
)
263
266
)
264
267
batch_service_client .task .add_collection (job_id , tasks )
@@ -327,7 +330,7 @@ def wait_for_tasks_to_complete(batch_service_client, job_id, timeout):
327
330
# Create a list of all MP4 files in the InputFiles directory.
328
331
input_file_paths = []
329
332
330
- for folder , subs , files in os .walk ('./ InputFiles/' ):
333
+ for folder , subs , files in os .walk (os . path . join ( sys . path [ 0 ], ' InputFiles' ) ):
331
334
for filename in files :
332
335
if filename .endswith (".mp4" ):
333
336
input_file_paths .append (os .path .abspath (os .path .join (folder , filename )))
@@ -374,7 +377,7 @@ def wait_for_tasks_to_complete(batch_service_client, job_id, timeout):
374
377
print (" Success! All tasks reached the 'Completed' state within the "
375
378
"specified timeout period." )
376
379
377
- except batchmodels .batch_error . BatchErrorException as err :
380
+ except batchmodels .BatchErrorException as err :
378
381
print_batch_exception (err )
379
382
raise
380
383
0 commit comments