mirror of
https://github.com/lilydjwg/nvchecker
synced 2024-12-18 04:34:44 +00:00
Merge pull request #237 from stepnem/notifyopt
nvchecker-notify: accept and pass --tries and --failures to nvchecker
This commit is contained in:
commit
3563d71fb2
@ -26,6 +26,11 @@ def get_args():
|
||||
parser.add_argument('-k', '--keyfile',
|
||||
metavar='FILE', type=str,
|
||||
help='use specified keyfile (override the one in configuration file)')
|
||||
parser.add_argument('-t', '--tries', default=1, type=int, metavar='N',
|
||||
help='try N times when network errors occur')
|
||||
parser.add_argument('--failures', action='store_true',
|
||||
help='exit with code 3 if failures / errors happen during checking')
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
def main():
|
||||
@ -43,6 +48,10 @@ def main():
|
||||
cmd.extend(['-c', args.file])
|
||||
if args.keyfile:
|
||||
cmd.extend(['-k', args.keyfile])
|
||||
if args.tries:
|
||||
cmd.extend(['-t', str(args.tries)])
|
||||
if args.failures:
|
||||
cmd.append('--failures')
|
||||
|
||||
process = subprocess.Popen(cmd, pass_fds=(wfd,))
|
||||
os.close(wfd)
|
||||
|
Loading…
Reference in New Issue
Block a user