Merge branch 'collectd-4.9' into collectd-4.10
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 6 Nov 2010 11:08:20 +0000 (12:08 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 6 Nov 2010 11:08:20 +0000 (12:08 +0100)
Conflicts:
src/collectd.conf.in
src/python.c

1  2 
README
configure.in
src/collectd-python.pod
src/collectd.h
src/curl_json.c
src/netapp.c
src/network.c
src/python.c
src/utils_match.c

diff --cc README
Simple merge
diff --cc configure.in
Simple merge
Simple merge
diff --cc src/collectd.h
Simple merge
diff --cc src/curl_json.c
Simple merge
diff --cc src/netapp.c
Simple merge
diff --cc src/network.c
Simple merge
diff --cc src/python.c
@@@ -962,22 -890,9 +962,23 @@@ static PyObject *cpy_oconfig_to_pyconfi
        return item;
  }
  
 +#ifdef IS_PY3K
 +static struct PyModuleDef collectdmodule = {
 +      PyModuleDef_HEAD_INIT,
 +      "collectd",   /* name of module */
 +      "The python interface to collectd", /* module documentation, may be NULL */
 +      -1,
 +      cpy_methods
 +};
 +
 +PyMODINIT_FUNC PyInit_collectd(void) {
 +      return PyModule_Create(&collectdmodule);
 +}
 +#endif
 +
  static int cpy_config(oconfig_item_t *ci) {
        int i;
+       char *argv = "";
        PyObject *sys, *tb;
        PyObject *sys_path;
        PyObject *module;
                cpy_log_exception("python initialization");
                return 1;
        }
+       PySys_SetArgv(1, &argv);
+       PyList_SetSlice(sys_path, 0, 1, NULL);
 +#ifdef IS_PY3K
 +      module = PyImport_ImportModule("collectd");
 +#else
        module = Py_InitModule("collectd", cpy_methods); /* Borrowed reference. */
 +#endif
        PyModule_AddObject(module, "Config", (void *) &ConfigType); /* Steals a reference. */
        PyModule_AddObject(module, "Values", (void *) &ValuesType); /* Steals a reference. */
        PyModule_AddObject(module, "Notification", (void *) &NotificationType); /* Steals a reference. */
Simple merge