From ca231f689f758db773375dd7adf0ba006e8bf132 Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Tue, 12 Feb 2008 22:29:31 +0000
Subject: [PATCH] svn merge -r13250:13257
 https://eris.llnl.gov/svn/slurm/branches/slurm-1.2

---
 NEWS                          |  2 ++
 doc/man/man1/srun.1           |  1 +
 src/common/read_config.c      |  7 +++++++
 src/slurmctld/partition_mgr.c | 16 ++++++++++++----
 4 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index e75ac754886..c74d3c3ef53 100644
--- a/NEWS
+++ b/NEWS
@@ -179,6 +179,8 @@ documents those changes that are of interest to users and admins.
     equivalent options for compatibility with srun.
  -- Add configuration parameter GetEnvTimeout for use with Moab. See 
     "man slurm.conf" for details.
+ -- If a partition's node list contains space separators, replace them with 
+    commas for easier parsing.
 
 * Changes in SLURM 1.2.22
 =========================
diff --git a/doc/man/man1/srun.1 b/doc/man/man1/srun.1
index 61dda118c73..0555879a49b 100644
--- a/doc/man/man1/srun.1
+++ b/doc/man/man1/srun.1
@@ -301,6 +301,7 @@ use only one core in each physical CPU
 .B [no]multithread
 [don't] use extra threads with in-core multi-threading
 which can benefit communication intensive applications
+.TP
 .B help
 show this help message
 .RE
diff --git a/src/common/read_config.c b/src/common/read_config.c
index 4753e9e1a0b..6ab20683535 100644
--- a/src/common/read_config.c
+++ b/src/common/read_config.c
@@ -502,6 +502,13 @@ static int parse_partitionname(void **dest, slurm_parser_enum_t type,
 		if (!s_p_get_string(&p->nodes, "Nodes", tbl)
 		    && !s_p_get_string(&p->nodes, "Nodes", dflt))
 			p->nodes = NULL;
+		else {
+			int i;
+			for (i=0; p->nodes[i]; i++) {
+				if (p->nodes[i] == ' ')
+					p->nodes[i] = ',';
+			}
+		}
 
 		if (!s_p_get_boolean(&p->root_only_flag, "RootOnly", tbl)
 		    && !s_p_get_boolean(&p->root_only_flag, "RootOnly", dflt))
diff --git a/src/slurmctld/partition_mgr.c b/src/slurmctld/partition_mgr.c
index 422cb1ed3a7..40fd18c53f9 100644
--- a/src/slurmctld/partition_mgr.c
+++ b/src/slurmctld/partition_mgr.c
@@ -883,12 +883,14 @@ int update_part(update_part_msg_t * part_desc)
 		xfree(part_ptr->allow_uids);
 		if ((strcasecmp(part_desc->allow_groups, "ALL") == 0) ||
 		    (part_desc->allow_groups[0] == '\0')) {
-			info("update_part: setting allow_groups to ALL for partition %s", 
+			info("update_part: setting allow_groups to ALL for "
+				"partition %s", 
 				part_desc->name);
 		} else {
 			part_ptr->allow_groups = part_desc->allow_groups;
 			part_desc->allow_groups = NULL;
-			info("update_part: setting allow_groups to %s for partition %s", 
+			info("update_part: setting allow_groups to %s for "
+				"partition %s", 
 				part_ptr->allow_groups, part_desc->name);
 			part_ptr->allow_uids =
 				_get_groups_members(part_ptr->allow_groups);
@@ -900,8 +902,14 @@ int update_part(update_part_msg_t * part_desc)
 
 		if (part_desc->nodes[0] == '\0')
 			part_ptr->nodes = NULL;	/* avoid empty string */
-		else
+		else {
+			int i;
 			part_ptr->nodes = xstrdup(part_desc->nodes);
+			for (i=0; part_ptr->nodes[i]; i++) {
+				if (part_ptr->nodes[i] == ' ')
+					part_ptr->nodes[i] = ',';
+			}
+		}
 
 		error_code = _build_part_bitmap(part_ptr);
 		if (error_code) {
@@ -909,7 +917,7 @@ int update_part(update_part_msg_t * part_desc)
 			part_ptr->nodes = backup_node_list;
 		} else {
 			info("update_part: setting nodes to %s for partition %s", 
-			     part_desc->nodes, part_desc->name);
+			     part_ptr->nodes, part_desc->name);
 			xfree(backup_node_list);
 		}
 	}
-- 
GitLab