git.samba.org
/
metze
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a572a26
)
py/dnsserver add flag from string function
author
Douglas Bagnall
<douglas.bagnall@catalyst.net.nz>
Thu, 1 Apr 2021 02:29:32 +0000
(15:29 +1300)
committer
Douglas Bagnall
<dbagnall@samba.org>
Thu, 8 Apr 2021 21:54:35 +0000
(21:54 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
python/samba/dnsserver.py
patch
|
blob
|
history
diff --git
a/python/samba/dnsserver.py
b/python/samba/dnsserver.py
index a6e2136b1dc0a786dbd08c80b3a5695fc10b5e7b..a9fcb7662e8184bc0771a93acbd731be38da8921 100644
(file)
--- a/
python/samba/dnsserver.py
+++ b/
python/samba/dnsserver.py
@@
-287,3
+287,11
@@
def record_from_string(t, data, sep=None, **kwargs):
raise DNSParseError("Unsupported record type") from e
return Record.from_string(data, sep=sep, **kwargs)
+
+
+def flag_from_string(rec_type):
+ rtype = rec_type.upper()
+ try:
+ return getattr(dnsp, 'DNS_TYPE_' + rtype)
+ except AttributeError:
+ raise DNSParseError('Unknown type of DNS record %s' % rec_type) from e