summaryrefslogtreecommitdiffstats
path: root/ipalib/util.py
diff options
context:
space:
mode:
authorPetr Spacek <pspacek@redhat.com>2016-05-17 17:20:25 +0200
committerMartin Basti <mbasti@redhat.com>2016-05-30 20:14:32 +0200
commitec49130b94d2aa195c6b704a30fe6c3137fabdbf (patch)
tree4cfc49b4132079b2baab6edf7c73eeddcbac3aac /ipalib/util.py
parent0c75df4bf3784eae08f41c176bbaab44c6d510a7 (diff)
downloadfreeipa-ec49130b94d2aa195c6b704a30fe6c3137fabdbf.tar.gz
freeipa-ec49130b94d2aa195c6b704a30fe6c3137fabdbf.tar.xz
freeipa-ec49130b94d2aa195c6b704a30fe6c3137fabdbf.zip
Use root_logger for verify_host_resolvable()
After discussion with Martin Basti we decided to standardize on root_logger with hope that one day we will use root_logger.getLogger('module') to make logging prettier and tunable per module. https://fedorahosted.org/freeipa/ticket/5710 Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipalib/util.py')
-rw-r--r--ipalib/util.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/ipalib/util.py b/ipalib/util.py
index 709bfbb8e..7d3a502e4 100644
--- a/ipalib/util.py
+++ b/ipalib/util.py
@@ -43,6 +43,7 @@ from ipapython.ssh import SSHPublicKey
from ipapython.dn import DN, RDN
from ipapython.dnsutil import DNSName
from ipapython.graph import Graph
+from ipapython.ipa_log_manager import root_logger
if six.PY3:
unicode = str
@@ -64,7 +65,8 @@ def json_serialize(obj):
return ''
return json_serialize(obj.__json__())
-def verify_host_resolvable(fqdn, log):
+
+def verify_host_resolvable(fqdn):
"""
See if the hostname has a DNS A/AAAA record.
"""
@@ -75,12 +77,12 @@ def verify_host_resolvable(fqdn, log):
for rdtype in ('A', 'AAAA'):
try:
answers = resolver.query(fqdn, rdtype)
- log.debug(
+ root_logger.debug(
'IPA: found %d %s records for %s: %s' % (len(answers),
rdtype, fqdn, ' '.join(str(answer) for answer in answers))
)
except DNSException:
- log.debug(
+ root_logger.debug(
'IPA: DNS %s record lookup failed for %s' %
(rdtype, fqdn)
)