Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is-online system and agent shouldn't accept arguments #1040

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

mkemel
Copy link
Member

@mkemel mkemel commented Feb 3, 2025

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.

@mkemel mkemel force-pushed the is-online-agent-arguments branch from 68cef3f to 43e3b15 Compare February 3, 2025 12:57
Copy link
Member

@engelmi engelmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

src/is-online/main.c Outdated Show resolved Hide resolved
@engelmi engelmi self-requested a review February 3, 2025 12:59
@mkemel mkemel force-pushed the is-online-agent-arguments branch from 43e3b15 to 544c955 Compare February 3, 2025 13:01
@coveralls
Copy link

coveralls commented Feb 3, 2025

Coverage Status

coverage: 82.251% (-0.1%) from 82.354%
when pulling 6ec3561 on mkemel:is-online-agent-arguments
into ee89048 on eclipse-bluechi:main.

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, and `bluechi-is-online node` to accept only one argument

Signed-off-by: Mark Kemel <mkemel@redhat.com>
@mkemel mkemel force-pushed the is-online-agent-arguments branch from 544c955 to 6ec3561 Compare February 3, 2025 13:16
@engelmi engelmi merged commit ec66625 into eclipse-bluechi:main Feb 3, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants