diff --git a/src/common/assoc_mgr.c b/src/common/assoc_mgr.c index 74b9279e66c6368965c5ef9b54d8682557651cba..f3ddf2141ed1dcb95995382c951276a972319bea 100644 --- a/src/common/assoc_mgr.c +++ b/src/common/assoc_mgr.c @@ -5478,9 +5478,9 @@ extern int assoc_mgr_find_tres_pos(slurmdb_tres_rec_t *tres_rec, bool locked) assoc_mgr_tres_array[i]->id == tres_rec->id) { tres_pos = i; break; - } else if (!xstrcmp(assoc_mgr_tres_array[i]->type, + } else if (!xstrcasecmp(assoc_mgr_tres_array[i]->type, tres_rec->type) && - !xstrcmp(assoc_mgr_tres_array[i]->name, + !xstrcasecmp(assoc_mgr_tres_array[i]->name, tres_rec->name)) { tres_pos = i; break; diff --git a/src/slurmctld/read_config.c b/src/slurmctld/read_config.c index 3f914cec0454ba0a3a9e29ef3b20d2200b204ae0..6d5f456b1c3ddb268c78ea68e87431e1ee9099ed 100644 --- a/src/slurmctld/read_config.c +++ b/src/slurmctld/read_config.c @@ -134,9 +134,21 @@ static int _compare_hostnames(struct node_record *old_node_table, struct node_record *node_table, int node_count); -static bool _is_configured_tres(char *type, char *name); +static bool _is_configured_tres(char *type, char *name) +{ + bool valid = false; + slurmdb_tres_rec_t tres_rec; + + memset(&tres_rec, 0, sizeof(slurmdb_tres_rec_t)); + tres_rec.type = type; + tres_rec.name = name; + + if (assoc_mgr_find_tres_pos(&tres_rec, false) != -1) + valid = true; + return valid; +} /* Convert the value of a k=v pair to a double. Inputs are the k=v string and an * integer offset representing the start of the value */ @@ -617,28 +629,6 @@ static int _build_all_nodeline_info(void) return rc; } - -static bool _is_configured_tres(char *type, char *name) -{ - ListIterator itr = NULL; - bool valid = false; - slurmdb_tres_rec_t *tres_rec; - - itr = list_iterator_create(cluster_tres_list); - while ((tres_rec = list_next(itr))) { - if (strcasecmp(type, tres_rec->type)) - continue; - - if ((!tres_rec->name) || /* cpu, mem, etc. */ - (!xstrcmp(name, tres_rec->name))) { /* gres, lic, etc. */ - valid = true; - break; - } - } - - return valid; -} - /* Convert a comma delimited list of account names into a NULL terminated * array of pointers to strings. Call accounts_list_free() to release memory */ extern void accounts_list_build(char *accounts, char ***accounts_array)