summaryrefslogtreecommitdiffstats
path: root/isys
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2008-09-24 16:06:27 -1000
committerDavid Cantrell <dcantrell@redhat.com>2008-09-24 16:09:22 -1000
commit3d0bd8bb289340f9b78c6fec28c39788d439af70 (patch)
tree277b3ec4d8fd0ce95b1e7e2a00b63ed86d421914 /isys
parent2021524989bc7105208fbfe10234f8f87d47fafb (diff)
downloadanaconda-3d0bd8bb289340f9b78c6fec28c39788d439af70.tar.gz
anaconda-3d0bd8bb289340f9b78c6fec28c39788d439af70.tar.xz
anaconda-3d0bd8bb289340f9b78c6fec28c39788d439af70.zip
Bring back isys.resetResolv() and fix NetworkManager polling in network.py.
Bring back the isys.resetResolv() function to kick glibc and make it reinitialize itself from /etc/resolv.conf again. We need to do this to account for NetworkManager writing out a new resolv.conf. In network.bringUp(), init i to 0 so we actually loop and poll NetworkManager's state.
Diffstat (limited to 'isys')
-rw-r--r--isys/isys.c14
-rwxr-xr-xisys/isys.py3
2 files changed, 17 insertions, 0 deletions
diff --git a/isys/isys.c b/isys/isys.c
index f9a2e560c..4ecf947d0 100644
--- a/isys/isys.c
+++ b/isys/isys.c
@@ -101,6 +101,7 @@ static PyObject * doWipeRaidSuperblock(PyObject * s, PyObject * args);
static PyObject * doGetRaidSuperblock(PyObject * s, PyObject * args);
static PyObject * doGetRaidChunkSize(PyObject * s, PyObject * args);
static PyObject * doDevSpaceFree(PyObject * s, PyObject * args);
+static PyObject * doResetResolv(PyObject * s, PyObject * args);
static PyObject * doLoadKeymap(PyObject * s, PyObject * args);
static PyObject * doClobberExt2 (PyObject * s, PyObject * args);
static PyObject * doReadE2fsLabel(PyObject * s, PyObject * args);
@@ -149,6 +150,7 @@ static PyMethodDef isysModuleMethods[] = {
{ "smpavailable", (PyCFunction) smpAvailable, METH_VARARGS, NULL },
{ "htavailable", (PyCFunction) htAvailable, METH_VARARGS, NULL },
{ "umount", (PyCFunction) doUMount, METH_VARARGS, NULL },
+ { "resetresolv", (PyCFunction) doResetResolv, METH_VARARGS, NULL },
{ "swapon", (PyCFunction) doSwapon, METH_VARARGS, NULL },
{ "swapoff", (PyCFunction) doSwapoff, METH_VARARGS, NULL },
{ "loadKeymap", (PyCFunction) doLoadKeymap, METH_VARARGS, NULL },
@@ -375,6 +377,18 @@ static PyObject * doPrefixToNetmask (PyObject * s, PyObject * args) {
return Py_BuildValue("s", dst);
}
+static PyObject * doResetResolv(PyObject * s, PyObject * args) {
+ if (!PyArg_ParseTuple(args, "")) {
+ return NULL;
+ }
+
+ /* reinit the resolver so DNS changes take affect */
+ res_init();
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
static PyObject * doWipeRaidSuperblock(PyObject * s, PyObject * args) {
int fd;
unsigned long size;
diff --git a/isys/isys.py b/isys/isys.py
index 8a1bea62c..189bd7fd1 100755
--- a/isys/isys.py
+++ b/isys/isys.py
@@ -725,6 +725,9 @@ def compareNetDevices(first, second):
else:
return 0
+def resetResolv():
+ return _isys.resetresolv()
+
def getDeviceByToken(token, value):
return _isys.getdevicebytoken(token, value)