Check when list of hosts is empty.
Fixes: https://pagure.io/koji/issue/2497
This commit is contained in:
parent
8b07fcf5bb
commit
5e861978c6
2 changed files with 13 additions and 0 deletions
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue