diff options
author | Petr Spacek <pspacek@redhat.com> | 2016-06-29 19:35:35 +0200 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2016-06-30 14:08:04 +0200 |
commit | 3b79ce005c43c6cb270175dc987eed3ba19e0f53 (patch) | |
tree | 80a3902dca48eddf737a3ed7c2f1da6c6c88702a | |
parent | 2615103c68e68596473260064dbe84585073eb51 (diff) | |
download | freeipa-3b79ce005c43c6cb270175dc987eed3ba19e0f53.tar.gz freeipa-3b79ce005c43c6cb270175dc987eed3ba19e0f53.tar.xz freeipa-3b79ce005c43c6cb270175dc987eed3ba19e0f53.zip |
DNS: Reinitialize DNS resolver after changing resolv.conf
Previously the installer did not reinitialize resolver so queries for
records created using --ip-address option might not be answered. This led
to incorrect results during 'Updating DNS system records' phase at the
end of installation.
This is kind of hack but right now we do not have enough time to extend
python-dns's interface with resolver_reinit() method.
https://fedorahosted.org/freeipa/ticket/5962
Reviewed-By: Martin Basti <mbasti@redhat.com>
-rw-r--r-- | ipaserver/install/bindinstance.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ipaserver/install/bindinstance.py b/ipaserver/install/bindinstance.py index ebb4212ab..f4ed63141 100644 --- a/ipaserver/install/bindinstance.py +++ b/ipaserver/install/bindinstance.py @@ -17,6 +17,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # +from __future__ import absolute_import from __future__ import print_function import tempfile @@ -27,6 +28,7 @@ import re import sys import time +import dns.resolver import ldap import six @@ -982,6 +984,10 @@ class BindInstance(service.Service): resolv_fd.close() except IOError as e: root_logger.error('Could not write to resolv.conf: %s', e) + else: + # python DNS might have global resolver cached in this variable + # we have to re-initialize it because resolv.conf has changed + dns.resolver.default_resolver = None def __generate_rndc_key(self): installutils.check_entropy() |