Description of problem: Out of these 3 cases, the middle one is, I believe, incorrect, since system-modify --help clearly specifies the <fqdn> as mandatory: $ bkr system-modify ; echo $? Usage: bkr system-modify [options] <fqdn> .. bkr: error: At least one option is required, specifying what to change 2 $ bkr system-modify --condition=Broken ; echo $? 0 $ bkr system-modify --condition=Broken non-existent-fqdn ; echo $? HTTP error: 404 Client Error: NOT FOUND System not found 1 Version-Release number of selected component (if applicable): beaker-client-21.0-1.fc22.noarch How reproducible: always Actual results: bkr system-modify returns 0 when no action was performed Expected results: bkr system-modify returns non-0 when given no fqdn, ie. like system-power; $ bkr system-power --action=on ; echo $? Usage: bkr system-power [options] <fqdn> bkr: error: Exactly one system fqdn must be given 2
https://gerrit.beaker-project.org/#/c/4829/
(In reply to Jiri Jaburek from comment #0) > Expected results: > bkr system-modify returns non-0 when given no fqdn, ie. like system-power; > $ bkr system-power --action=on ; echo $? > Usage: bkr system-power [options] <fqdn> > > bkr: error: Exactly one system fqdn must be given > 2 To be clear, we won't make bkr system-modify accept exactly one FQDN, even though some of the other client commands do that. Right now it accepts multiple FQDNs and changing that would break people's scripts (for no good reason). So the expected result here is more like: $ bkr system-modify bkr: error: Specify one or more system FQDNs to modify with a non-zero exit status.
I based my expected result on the manpage, which says bkr system-modify [options] <fqdn> .. for >= 0 fqdns, I'd expect: bkr system-modify [options] [fqdn]... (like most GNU commands have) Making it accept one or more is also a viable alternative.
Mainly I was writing to clarify because Blake was not sure if we should accept exactly one fqdn, or one or more fqdns. It has to be the latter for compatibility. For one or more fqdns I think the help we have now is correct, right?
(In reply to Dan Callaghan from comment #4) > Mainly I was writing to clarify because Blake was not sure if we should > accept exactly one fqdn, or one or more fqdns. It has to be the latter for > compatibility. > > For one or more fqdns I think the help we have now is correct, right? I think so. The more traditional (GNU) way is to use 3 dots without a space, like <fqdn>... or FQDN... with some tools using ie. <fqdn> [fqdn]... but anything reasonable works, I guess.
The client to be used to test this bug should be beaker-client-23.0-0.git.212.a10d3a6
For reference, the repositories providing nightlies can be found under: https://beaker-project.org/nightlies/develop/
Beaker 23.0 has been released.