Check CLI arguments for enable/disable host

Fixes: https://pagure.io/koji/issue/1364
This commit is contained in:
Tomas Kopecek 2019-03-25 16:08:15 +01:00 committed by Mike McLean
parent b92fa538dd
commit 0b30e73053
3 changed files with 44 additions and 9 deletions

View file

@ -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: