]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Adding command line parameter 'timeout' to lib/pp_admintools/app/pdns.py
authorFrank Brehm <frank.brehm@pixelpark.com>
Fri, 18 Nov 2022 09:25:58 +0000 (10:25 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Fri, 18 Nov 2022 09:25:58 +0000 (10:25 +0100)
lib/pp_admintools/app/pdns.py

index cedfeddab583c7ec5b1f2ead275c239df289b6d6..6f0a989f0149cb32eebd958372c42bbdbbb972b3 100644 (file)
@@ -21,6 +21,7 @@ import socket
 import psutil
 
 # Own modules
+from fb_tools import MAX_TIMEOUT
 from fb_tools.xlate import format_list
 
 from fb_pdnstools.zone import PowerDNSZone
@@ -276,6 +277,14 @@ class PpPDNSApplication(BaseMailApplication):
                 PdnsConfiguration.default_pdns_api_port),
         )
 
+        help_msg=_(
+            "The timeout in seconds for the communication with the PowerDNS-API. "
+            "Default: {} seconds.").format(PdnsConfiguration.default_pdns_timeout)
+        pdns_group.add_argument(
+            '-T', '--timeout', meta=_("SECONDS"), type=int, dest='timeout',
+            help=help_msg,
+        )
+
         super(PpPDNSApplication, self).init_arg_parser()
 
     # -------------------------------------------------------------------------