Check when list of hosts is empty.

Fixes: https://pagure.io/koji/issue/2497
This commit is contained in:
Jana Cupova 2021-05-12 16:31:39 +02:00
parent 8b07fcf5bb
commit 5e861978c6
2 changed files with 13 additions and 0 deletions

View file

@ -2902,6 +2902,10 @@ def anon_handle_list_hosts(goptions, session, args):
tmp_list = sorted([(x['name'], x) for x in session.listHosts(**opts)])
hosts = [x[1] for x in tmp_list]
if not hosts:
warn("No hosts found.")
return
def yesno(x):
if x:
return 'Y'