summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-02-14 14:56:58 +0100
committerStefan Metzmacher <metze@samba.org>2008-02-15 08:49:47 +0100
commit17f31a7677a585834d8d172a67bf39bfda048a46 (patch)
tree0334b0657502a8f750b876791447f9e7a7f7b563
parent81db8319732925ce2fbf8d853feac2abb0a8a59d (diff)
downloadsamba-17f31a7677a585834d8d172a67bf39bfda048a46.tar.gz
samba-17f31a7677a585834d8d172a67bf39bfda048a46.tar.bz2
samba-17f31a7677a585834d8d172a67bf39bfda048a46.zip
NET-API-BECOME-DC: at least find the 'provision' function in python mode
This is still broken, as we call provision() with wrong arguments. Also the python provision() function, doesn't allow us to specify the locations of the partition ldb files, this is strictly needed otherwise the torture test destroys a production databases. I think we should have a provision_become_dc() again! metze (This used to be commit 096eafd34778dde222bce4b0a5c0fc38b7de0359)
-rw-r--r--source4/torture/libnet/libnet_BecomeDC.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/source4/torture/libnet/libnet_BecomeDC.c b/source4/torture/libnet/libnet_BecomeDC.c
index 0dd06bda4c..997dbc93b8 100644
--- a/source4/torture/libnet/libnet_BecomeDC.c
+++ b/source4/torture/libnet/libnet_BecomeDC.c
@@ -284,6 +284,7 @@ static NTSTATUS test_become_dc_prepare_db_py(void *private_data,
{
struct test_become_dc_state *s = talloc_get_type(private_data, struct test_become_dc_state);
bool ok;
+ PyObject *module, *module_dict;
PyObject *provision_fn, *result, *parameters;
DEBUG(0,("Provision for Become-DC test using PYTHON\n"));
@@ -293,13 +294,24 @@ static NTSTATUS test_become_dc_prepare_db_py(void *private_data,
py_update_path("bin"); /* FIXME: Can't assume this always runs in source/... */
- provision_fn = PyImport_Import(PyString_FromString("samba.provision.provision"));
+ module = PyImport_Import(PyString_FromString("samba.provision"));
+ if (module == NULL) {
+ DEBUG(0, ("Unable to import 'samba.provision' Python module.\n"));
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+
+ module_dict = PyModule_GetDict(module);
+ if (module_dict == NULL) {
+ DEBUG(0, ("Unable to GetDict of 'samba.provision'.\n"));
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+ provision_fn = PyDict_GetItemString(module_dict, "provision");
if (provision_fn == NULL) {
- DEBUG(0, ("Unable to import provision Python module.\n"));
- return NT_STATUS_UNSUCCESSFUL;
+ DEBUG(0, ("Unable to get function 'provision' of 'samba.provision'.\n"));
+ return NT_STATUS_UNSUCCESSFUL;
}
-
+
DEBUG(0,("New Server[%s] in Site[%s]\n",
p->dest_dsa->dns_name, p->dest_dsa->site_name));