Red Hat Bugzilla – Bug 1268811
bkr system-modify succeeds without fqdn
Last modified: 2016-07-07 19:12:35 EDT
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
$ bkr system-modify --condition=Broken ; echo $?
$ bkr system-modify --condition=Broken non-existent-fqdn ; echo $?
HTTP error: 404 Client Error: NOT FOUND
System not found
Version-Release number of selected component (if applicable):
bkr system-modify returns 0 when no action was performed
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
(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
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
> 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
with some tools using ie.
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:
Beaker 23.0 has been released.