#NEWLINE# def _vault_sync( self , vault_name , max_age_hours , fix , wait ) : #NEWLINE# #INDENT# vault = self . connection . get_vault ( vault_name ) #NEWLINE# inventory_jobs = find_inventory_jobs ( vault , max_age_hours = max_age_hours ) #NEWLINE# complete_job = find_complete_job ( inventory_jobs ) #NEWLINE# if complete_job : #NEWLINE# #INDENT# self . _vault_sync_reconcile ( vault , complete_job , fix = fix ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if has_pending_job ( inventory_jobs ) : #NEWLINE# #INDENT# if wait : #NEWLINE# #INDENT# complete_job = wait_until_job_completed ( inventory_jobs ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise RetryConsoleError ( ( 'job still pending for inventory on %r' % vault . name ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# job_id = vault . retrieve_inventory ( ) #NEWLINE# job = vault . get_job ( job_id ) #NEWLINE# if wait : #NEWLINE# #INDENT# wait_until_job_completed ( [ job ] ) #NEWLINE# self . _vault_sync_reconcile ( vault , job , fix = fix ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise RetryConsoleError ( ( 'queued inventory job for %r' % vault . name ) )