From c8e682f72e38850ccd2c7189323297e61841b482 Mon Sep 17 00:00:00 2001
From: Danny Auble <da@llnl.gov>
Date: Fri, 6 Aug 2010 22:00:42 +0000
Subject: [PATCH] fix bad node counts

---
 src/sacctmgr/cluster_functions.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/sacctmgr/cluster_functions.c b/src/sacctmgr/cluster_functions.c
index 12ecbc53a50..649e926639f 100644
--- a/src/sacctmgr/cluster_functions.c
+++ b/src/sacctmgr/cluster_functions.c
@@ -457,6 +457,9 @@ extern int sacctmgr_list_cluster(int argc, char *argv[])
 	while((cluster = list_next(itr))) {
 		int curr_inx = 1;
 		slurmdb_association_rec_t *assoc = cluster->root_assoc;
+		/* set up the working cluster rec so nodecnt's and node names
+		 * are handled correctly */
+		working_cluster_rec = cluster;
 		while((field = list_next(itr2))) {
 			switch(field->type) {
 			case PRINT_CLUSTER:
@@ -634,6 +637,8 @@ extern int sacctmgr_list_cluster(int argc, char *argv[])
 		list_iterator_reset(itr2);
 		printf("\n");
 	}
+	/* clear the working cluster rec */
+	working_cluster_rec = NULL;
 
 	list_iterator_destroy(itr2);
 	list_iterator_destroy(itr);
-- 
GitLab