Skip to content

Commit

Permalink
is-online system and agent shouldn't accept arguments
Browse files Browse the repository at this point in the history
It was found that running
`bluechi-is-online agent --monitor 5000 --wait=10000`
Does not return error, although `--monitor` is a flag. The reason is
that `--monitor` is configured as a flag, and 5000 is treated as an
argument, which the method `agent` is configured to accept (min 0,
max 2), and the same goes for `system` method. Actually, these two
methods do not expect any arguments at all.

This change will limit the usage of `bluechi-is-online agent` and
`bluechi-is-online system` to not expect arguments, only the allowed
options.

Signed-off-by: Mark Kemel <mkemel@redhat.com>
  • Loading branch information
mkemel committed Feb 3, 2025
1 parent d394690 commit 43e3b15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/is-online/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ int method_version(UNUSED Command *command, UNUSED void *userdata) {
const Method methods[] = {
{ "help", 0, 0, OPT_NONE, method_help, usage },
{ "version", 0, 0, OPT_NONE, method_version, usage },
{ "agent", 0, 2, OPT_MONITOR | OPT_WAIT | OPT_SWITCH_CTRL_TIMEOUT, method_is_online_agent, usage },
{ "agent", 0, 0, OPT_MONITOR | OPT_WAIT | OPT_SWITCH_CTRL_TIMEOUT, method_is_online_agent, usage },
{ "node", 1, 3, OPT_MONITOR | OPT_WAIT, method_is_online_node, usage },
{ "system", 0, 2, OPT_MONITOR | OPT_WAIT, method_is_online_system, usage },
{ "system", 0, 0, OPT_MONITOR | OPT_WAIT, method_is_online_system, usage },
{ NULL, 0, 0, 0, NULL, NULL }
};

Expand Down

0 comments on commit 43e3b15

Please sign in to comment.