Reset the resolver cache after bringing up the network (#562209).
Throughout stage2 if we bring up the network after doing various actions,
we need to make sure the DNS resolver is reset to pick up the new information.
However, pycurl/libcurl uses the c-ares resolver which does not have a
method similar to res_init. Instead we need to tear down the pycurl.Curl
object instance cached in urlgrabber and create a new one. This does the
same thing as re-reading /etc/resolv.conf, but in more steps.
---
anaconda.spec.in | 4 ++--
iw/task_gui.py | 7 +++++++
yuminstall.py | 14 +++++++++++++-
3 files changed, 22 insertions(+), 3 deletions(-)
@@ -690,6 +694,8 @@ class AnacondaYum(YumSorter):
custom_buttons=[_("_Exit installer")])
sys.exit(1)
+ urlgrabber.grabber.reset_curl_obj()
+
dest = tempfile.mkdtemp("", ksrepo.name.replace(" ", ""), "/mnt")
# handle "nfs://" prefix
@@ -785,6 +791,8 @@ class AnacondaYum(YumSorter):
if not self.anaconda.intf.enableNetwork():
return
+ urlgrabber.grabber.reset_curl_obj()
+
rc = self.anaconda.intf.messageWindow(_("Error"),
_("The file %s cannot be opened. This is due to a missing "
"file, a corrupt package or corrupt media. Please "
@@ -1153,6 +1161,8 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
custom_buttons=[_("_Exit installer")])
sys.exit(1)
+ urlgrabber.grabber.reset_curl_obj()
+
self.doRepoSetup(anaconda)
self.doSackSetup(anaconda)
self.doGroupSetup(anaconda)
@@ -1231,7 +1241,9 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
if repo.needsNetwork() and not network.hasActiveNetDev():
if anaconda.intf.enableNetwork():
repo.mirrorlistparsed = False
- continue
+ continue
+
+ urlgrabber.grabber.reset_curl_obj()
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
02-22-2010, 07:38 AM
Ales Kozumplik
Reset the resolver cache after bringing up the network (#562209).
On 02/19/2010 10:04 PM, Chris Lumens wrote:
Throughout stage2 if we bring up the network after doing various actions,
we need to make sure the DNS resolver is reset to pick up the new information.
However, pycurl/libcurl uses the c-ares resolver which does not have a
method similar to res_init. Instead we need to tear down the pycurl.Curl
object instance cached in urlgrabber and create a new one. This does the
same thing as re-reading /etc/resolv.conf, but in more steps.