Skip to content
Snippets Groups Projects
Commit 66fddac3 authored by Don Lipari's avatar Don Lipari
Browse files

Fixed bug in sacctmgr to disambiguate Preempt from PreemptMode

parent d0ba9623
No related branches found
No related tags found
No related merge requests found
......@@ -402,16 +402,17 @@ static print_field_t *_get_print_field(char *object)
field->name = xstrdup("PluginIDSelect");
field->len = 14;
field->print_routine = print_fields_uint;
} else if (!strncasecmp("Preempt", object, MAX(command_len, 7))) {
field->type = PRINT_PREE;
field->name = xstrdup("Preempt");
field->len = 10;
field->print_routine = sacctmgr_print_qos_bitstr;
} else if (!strncasecmp("PreemptMode", object, MAX(command_len, 8))) {
field->type = PRINT_PREEM;
field->name = xstrdup("PreemptMode");
field->len = 11;
field->print_routine = print_fields_str;
/* Preempt needs to follow PreemptMode */
} else if (!strncasecmp("Preempt", object, MAX(command_len, 7))) {
field->type = PRINT_PREE;
field->name = xstrdup("Preempt");
field->len = 10;
field->print_routine = sacctmgr_print_qos_bitstr;
} else if (!strncasecmp("Priority", object, MAX(command_len, 3))) {
field->type = PRINT_PRIO;
field->name = xstrdup("Priority");
......
......@@ -195,7 +195,7 @@ static int _set_cond(int *start, int argc, char *argv[],
}
list_iterator_destroy(itr);
} else if (!strncasecmp (argv[i], "PreemptMode",
MAX(command_len, 3))) {
MAX(command_len, 8))) {
if(!qos_cond)
continue;
qos_cond->preempt_mode |=
......@@ -378,6 +378,19 @@ static int _set_rec(int *start, int argc, char *argv[],
" Bad MaxWall time format: %s\n",
argv[i]);
}
} else if (!strncasecmp (argv[i], "PreemptMode",
MAX(command_len, 8))) {
if(!qos)
continue;
qos->preempt_mode = preempt_mode_num(argv[i]+end);
if(qos->preempt_mode == (uint16_t)NO_VAL) {
fprintf(stderr,
" Bad Preempt Mode given: %s\n",
argv[i]);
exit_code = 1;
} else
set = 1;
/* Preempt needs to follow PreemptMode */
} else if (!strncasecmp (argv[i], "Preempt",
MAX(command_len, 7))) {
if(!qos)
......@@ -397,18 +410,6 @@ static int _set_rec(int *start, int argc, char *argv[],
set = 1;
else
exit_code = 1;
} else if (!strncasecmp (argv[i], "PreemptMode",
MAX(command_len, 8))) {
if(!qos)
continue;
qos->preempt_mode = preempt_mode_num(argv[i]+end);
if(qos->preempt_mode == (uint16_t)NO_VAL) {
fprintf(stderr,
" Bad Preempt Mode given: %s\n",
argv[i]);
exit_code = 1;
} else
set = 1;
} else if (!strncasecmp (argv[i], "Priority",
MAX(command_len, 3))) {
if(!qos)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment