fix: exit with 1 when handler mismatches type

This commit is contained in:
ptrcnull 2024-03-16 07:30:32 +01:00
parent dfb239346b
commit e3a61d3eb6
Signed by: ptrcnull
GPG key ID: 411F7B30801DD9CA

View file

@ -38,6 +38,10 @@ def main() -> None:
handler_name = config.get_handler(zone_name) handler_name = config.get_handler(zone_name)
handler = handlers[handler_name](zone_name, config, args.token) handler = handlers[handler_name](zone_name, config, args.token)
if (args.type == 'dns-01') == (handler_name == 'http'):
log.error('wrong handler for type, try again')
sys.exit(1)
if args.method == 'begin': if args.method == 'begin':
handler.create(short_record_name, args.auth) handler.create(short_record_name, args.auth)
else: else: