mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Move dnsclient into ipa-python so that I will be able to use it in ipaconfig
This commit is contained in:
parent
f169641aae
commit
c0b809efd5
@ -3,7 +3,6 @@ NULL =
|
|||||||
appdir = $(IPA_DATA_DIR)/ipaclient
|
appdir = $(IPA_DATA_DIR)/ipaclient
|
||||||
app_PYTHON = \
|
app_PYTHON = \
|
||||||
__init__.py \
|
__init__.py \
|
||||||
dnsclient.py \
|
|
||||||
ipachangeconf.py \
|
ipachangeconf.py \
|
||||||
ipadiscovery.py \
|
ipadiscovery.py \
|
||||||
ntpconf.py \
|
ntpconf.py \
|
||||||
|
@ -18,5 +18,5 @@
|
|||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
#
|
#
|
||||||
|
|
||||||
__all__ = ["ipadiscovery", "ipachangeconf", "dnsclient"]
|
__all__ = ["ipadiscovery", "ipachangeconf"]
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
import socket
|
import socket
|
||||||
import logging
|
import logging
|
||||||
import dnsclient
|
import ipa.dnsclient
|
||||||
import ldap
|
import ldap
|
||||||
from ldap import LDAPError
|
from ldap import LDAPError
|
||||||
|
|
||||||
@ -191,10 +191,10 @@ class IPADiscovery:
|
|||||||
# terminate the name
|
# terminate the name
|
||||||
if not qname.endswith("."):
|
if not qname.endswith("."):
|
||||||
qname += "."
|
qname += "."
|
||||||
results = dnsclient.query(qname, dnsclient.DNS_C_IN, dnsclient.DNS_T_SRV)
|
results = ipa.dnsclient.query(qname, ipa.dnsclient.DNS_C_IN, ipa.dnsclient.DNS_T_SRV)
|
||||||
|
|
||||||
for result in results:
|
for result in results:
|
||||||
if result.dns_type == dnsclient.DNS_T_SRV:
|
if result.dns_type == ipa.dnsclient.DNS_T_SRV:
|
||||||
rserver = result.rdata.server.rstrip(".")
|
rserver = result.rdata.server.rstrip(".")
|
||||||
if result.rdata.port and result.rdata.port != 389:
|
if result.rdata.port and result.rdata.port != 389:
|
||||||
rserver += ":" + str(result.rdata.port)
|
rserver += ":" + str(result.rdata.port)
|
||||||
@ -214,10 +214,10 @@ class IPADiscovery:
|
|||||||
# terminate the name
|
# terminate the name
|
||||||
if not qname.endswith("."):
|
if not qname.endswith("."):
|
||||||
qname += "."
|
qname += "."
|
||||||
results = dnsclient.query(qname, dnsclient.DNS_C_IN, dnsclient.DNS_T_TXT)
|
results = ipa.dnsclient.query(qname, ipa.dnsclient.DNS_C_IN, ipa.dnsclient.DNS_T_TXT)
|
||||||
|
|
||||||
for result in results:
|
for result in results:
|
||||||
if result.dns_type == dnsclient.DNS_T_TXT:
|
if result.dns_type == ipa.dnsclient.DNS_T_TXT:
|
||||||
realm = result.rdata.data
|
realm = result.rdata.data
|
||||||
if realm:
|
if realm:
|
||||||
break
|
break
|
||||||
@ -228,9 +228,9 @@ class IPADiscovery:
|
|||||||
# terminate the name
|
# terminate the name
|
||||||
if not qname.endswith("."):
|
if not qname.endswith("."):
|
||||||
qname += "."
|
qname += "."
|
||||||
results = dnsclient.query(qname, dnsclient.DNS_C_IN, dnsclient.DNS_T_SRV)
|
results = ipa.dnsclient.query(qname, ipa.dnsclient.DNS_C_IN, ipa.dnsclient.DNS_T_SRV)
|
||||||
for result in results:
|
for result in results:
|
||||||
if result.dns_type == dnsclient.DNS_T_SRV:
|
if result.dns_type == ipa.dnsclient.DNS_T_SRV:
|
||||||
qname = result.rdata.server.rstrip(".")
|
qname = result.rdata.server.rstrip(".")
|
||||||
if result.rdata.port and result.rdata.port != 88:
|
if result.rdata.port and result.rdata.port != 88:
|
||||||
qname += ":" + str(result.rdata.port)
|
qname += ":" + str(result.rdata.port)
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
include *.conf
|
include *.conf
|
||||||
include freeipa-python.spec*
|
include ipa-python.spec*
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user