ToastFreeware
/
toast
/
tdyndns.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
912587d
)
Now using common base class for exceptions.
author
Philipp Spitzer
<philipp@spitzer.priv.at>
Wed, 27 Jul 2016 18:24:17 +0000
(20:24 +0200)
committer
gregor herrmann
<gregoa@debian.org>
Wed, 27 Jul 2016 22:21:38 +0000
(
00:21
+0200)
bin/tdyndns_update
patch
|
blob
|
history
diff --git
a/bin/tdyndns_update
b/bin/tdyndns_update
index 8f943f8fbeee8f8761db745ca965adbac1a0403b..ce0b73a7510a7b0d163a8b1560b4988a6d07cbf0 100755
(executable)
--- a/
bin/tdyndns_update
+++ b/
bin/tdyndns_update
@@
-6,12
+6,16
@@
from subprocess import Popen, PIPE, call
import ipaddr
import ipaddr
-class NsupdateError(Exception):
+class ExternalProgramError(RuntimeError):
+ pass
+
+
+class NsupdateError(ExternalProgramError):
def __init__(self, returncode):
self.returncode = returncode
def __init__(self, returncode):
self.returncode = returncode
-class BlockipError(Ex
ception
):
+class BlockipError(Ex
ternalProgramError
):
def __init__(self, returncode):
self.returncode = returncode
def __init__(self, returncode):
self.returncode = returncode
@@
-82,7
+86,7
@@
def main(args):
nsupdate_add(args.fqdn, args.ttl, args.ip)
if ipfamily_by_ip(args.ip) == 'A':
blockip_whitelist_add(args.ip)
nsupdate_add(args.fqdn, args.ttl, args.ip)
if ipfamily_by_ip(args.ip) == 'A':
blockip_whitelist_add(args.ip)
- except
Nsupdate
Error as e:
+ except
ExternalProgram
Error as e:
sys.exit(e.returncode)
sys.exit(e.returncode)