Check CLI arguments for enable/disable host
Fixes: https://pagure.io/koji/issue/1364
This commit is contained in:
parent
b92fa538dd
commit
0b30e73053
3 changed files with 44 additions and 9 deletions
|
|
@ -1016,6 +1016,9 @@ def handle_disable_host(goptions, session, args):
|
|||
parser.add_option("--comment", help=_("Comment indicating why the host(s) are being disabled"))
|
||||
(options, args) = parser.parse_args(args)
|
||||
|
||||
if not args:
|
||||
parser.error(_("At least one host must be specified"))
|
||||
|
||||
activate_session(session, goptions)
|
||||
session.multicall = True
|
||||
for host in args:
|
||||
|
|
@ -1044,6 +1047,9 @@ def handle_enable_host(goptions, session, args):
|
|||
parser.add_option("--comment", help=_("Comment indicating why the host(s) are being enabled"))
|
||||
(options, args) = parser.parse_args(args)
|
||||
|
||||
if not args:
|
||||
parser.error(_("At least one host must be specified"))
|
||||
|
||||
activate_session(session, goptions)
|
||||
session.multicall = True
|
||||
for host in args:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue