From dbfbcfe96d094bfda6fcbbf228905bc05367d6b9 Mon Sep 17 00:00:00 2001
From: Tim Wickberg <tim@schedmd.com>
Date: Thu, 2 Jun 2016 16:59:39 -0400
Subject: [PATCH] Print correct return code on failure to update node features
 through sview

Wrong order of operations results in the return code being 0/1.
---
 NEWS                  | 1 +
 src/sview/node_info.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index afef492f983..53ecd48d375 100644
--- a/NEWS
+++ b/NEWS
@@ -51,6 +51,7 @@ documents those changes that are of interest to users and administrators.
     and two others that cause incorrect debug messages.
  -- Fix backwards compatibility with sreport going to <= 14.11 coming from
     >= 15.08 for some reports.
+ -- Print correct return code on failure to update node features through sview.
 
 * Changes in Slurm 15.08.11
 ===========================
diff --git a/src/sview/node_info.c b/src/sview/node_info.c
index b9443a7aec7..f3c8d1eb239 100644
--- a/src/sview/node_info.c
+++ b/src/sview/node_info.c
@@ -1173,7 +1173,7 @@ extern int update_features_node(GtkDialog *dialog, const char *nodelist,
 			g_free(edit);
 			goto end_it;
 		}
-		if ((rc = slurm_update_node(node_msg) == SLURM_SUCCESS)) {
+		if ((rc = slurm_update_node(node_msg)) == SLURM_SUCCESS) {
 			edit = g_strdup_printf(
 				"Node(s) %s updated successfully.",
 				nodelist);
-- 
GitLab