fixed cluster node names

This commit is contained in:
roberto@sirius
2011-01-01 12:03:12 +01:00
parent 31892a69df
commit 94f3b715e5
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -1861,7 +1861,7 @@ PyObject *py_uwsgi_cluster_node_name(PyObject * self, PyObject * args) {
int i;
char *node = NULL;
if (!PyArg_ParseTuple(args, "s:cluster_node_name", &node)) {
if (!PyArg_ParseTuple(args, "|s:cluster_node_name", &node)) {
return NULL;
}
@@ -1872,6 +1872,7 @@ PyObject *py_uwsgi_cluster_node_name(PyObject * self, PyObject * args) {
for (i = 0; i < MAX_CLUSTER_NODES; i++) {
ucn = &uwsgi.shared->nodes[i];
if (ucn->name[0] != 0) {
uwsgi_log("node_name: %s %s\n", node, ucn->name);
if (!strcmp(ucn->name, node)) {
return PyString_FromString(ucn->nodename);
}