def pull_remote(): git.pull()
except FileNotFoundError: # Assume something wrong has happened exit_info = [] log('Exit information: [{}] {}'.format(ecode, ", ".join(exit_info) or "None")) if 'no_standby' in exit_info and 'standby' in persistent_arguments: persistent_arguments.remove('standby') elif 'standby' in exit_info and 'standby' not in persistent_arguments: persistent_arguments.append('standby') if 'pull_update' in exit_info: log('Pull in new updates') git.checkout('deploy') git.pull() count = 0 crashcount = 0 elif 'early_exception' in exit_info: count += 1 log('Incremented crash count: {}; sleeping before restart'.format( count)) sleep(5) if crashcount == 2: log('Crash count triggered reverted state') git.checkout('HEAD~1') count = 0