rattail-fabric2/rattail_fabric2/deploy/rattail/check-datasync-queue.mako
Lance Edgar b58c0da7a4 Use python instead of shell script, for datasync checks
seems to give more clarity, and we'll have more options this way
2021-11-11 11:58:09 -06:00

34 lines
620 B
Mako
Executable file

#!${envroot}/bin/python
import os
import sys
import argparse
import subprocess
def check_datasync_queue(timeout):
os.chdir(sys.prefix)
retcode = subprocess.call([
'bin/rattail',
'-c', 'app/${config}.conf',
'--no-versioning',
'datasync',
'--timeout', timeout,
'check',
])
if retcode == 1:
sys.exit(2)
elif retcode:
print("unknown issue")
sys.exit(3)
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('timeout')
args = parser.parse_args()
check_datasync_queue(args.timeout)