summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-03-09 23:34:10 +1100
committerAndrew Bartlett <abartlet@samba.org>2010-03-11 11:27:48 +1100
commit3723e32e8cca79b52b97d6d6f4cda8ce5ce1bd33 (patch)
tree64c132ba455623a4522a3c9ac34e173c92904dc6 /source4/scripting/python
parent79b4a3b22e8a70844b9654f057f6169c553cc809 (diff)
downloadsamba-3723e32e8cca79b52b97d6d6f4cda8ce5ce1bd33.tar.gz
samba-3723e32e8cca79b52b97d6d6f4cda8ce5ce1bd33.tar.bz2
samba-3723e32e8cca79b52b97d6d6f4cda8ce5ce1bd33.zip
s4:samba_dnsupdate Add a 'file based' mode to samba_dnsupdate
For the testsuite to use DNS like names, we need to write these names to a file. Also, to have this run in 'make test' the usual rules about 'no 127.*' IP addresses in DNS must be skipped, so glue.interface_ips takes two arguments now
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/pyglue.c7
-rw-r--r--source4/scripting/python/samba/provision.py2
2 files changed, 5 insertions, 4 deletions
diff --git a/source4/scripting/python/pyglue.c b/source4/scripting/python/pyglue.c
index 6fe789ae73..89cf18e16a 100644
--- a/source4/scripting/python/pyglue.c
+++ b/source4/scripting/python/pyglue.c
@@ -614,8 +614,9 @@ static PyObject *py_interface_ips(PyObject *self, PyObject *args)
struct loadparm_context *lp_ctx;
struct interface *ifaces;
int i, ifcount;
+ int all_interfaces;
- if (!PyArg_ParseTuple(args, "O", &py_lp_ctx))
+ if (!PyArg_ParseTuple(args, "Oi", &py_lp_ctx, &all_interfaces))
return NULL;
lp_ctx = lp_from_py_object(py_lp_ctx);
@@ -633,7 +634,7 @@ static PyObject *py_interface_ips(PyObject *self, PyObject *args)
/* first count how many are not loopback addresses */
for (ifcount = i = 0; i<count; i++) {
const char *ip = iface_n_ip(ifaces, i);
- if (!iface_same_net(ip, "127.0.0.1", "255.0.0.0")) {
+ if (!(!all_interfaces && iface_same_net(ip, "127.0.0.1", "255.0.0.0"))) {
ifcount++;
}
}
@@ -641,7 +642,7 @@ static PyObject *py_interface_ips(PyObject *self, PyObject *args)
pylist = PyList_New(ifcount);
for (ifcount = i = 0; i<count; i++) {
const char *ip = iface_n_ip(ifaces, i);
- if (!iface_same_net(ip, "127.0.0.1", "255.0.0.0")) {
+ if (!(!all_interfaces && iface_same_net(ip, "127.0.0.1", "255.0.0.0"))) {
PyList_SetItem(pylist, ifcount, PyString_FromString(ip));
ifcount++;
}
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py
index cb90141730..bac234cfac 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -1182,7 +1182,7 @@ def provision(setup_dir, message, session_info,
paths.bind_gid = bind_gid
if hostip is None:
- hostips = glue.interface_ips(lp)
+ hostips = glue.interface_ips(lp, False)
if len(hostips) == 0:
message("No external IPv4 address has been found: I use the loopback.")
hostip = '127.0.0.1'