b58c0da7a4
seems to give more clarity, and we'll have more options this way
35 lines
664 B
Mako
Executable file
35 lines
664 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/datasync.conf',
|
|
'-c', 'app/${config}.conf',
|
|
'--no-versioning',
|
|
'datasync',
|
|
'--timeout', timeout,
|
|
'check-watchers',
|
|
])
|
|
|
|
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)
|
|
|