diff --git a/hub/kojihub.py b/hub/kojihub.py
index a8531851..45e6973e 100644
--- a/hub/kojihub.py
+++ b/hub/kojihub.py
@@ -6239,9 +6239,15 @@ class RootExports(object):
joins.append('host_channels on host.id = host_channels.host_id')
clauses.append('host_channels.channel_id = %(channelID)i')
if ready != None:
- clauses.append('ready is %s' % ready)
+ if ready:
+ clauses.append('ready is true')
+ else:
+ clauses.append('ready is false')
if enabled != None:
- clauses.append('enabled is %s' % enabled)
+ if enabled:
+ clauses.append('enabled is true')
+ else:
+ clauses.append('enabled is false')
if userID != None:
clauses.append('user_id = %(userID)i')
diff --git a/www/kojiweb/hosts.chtml b/www/kojiweb/hosts.chtml
index 3466cd6b..0750f777 100644
--- a/www/kojiweb/hosts.chtml
+++ b/www/kojiweb/hosts.chtml
@@ -1,15 +1,32 @@
#from kojiweb import util
+#attr _PASSTHROUGH = ['state', 'order']
+
#include "includes/header.chtml"
Hosts
+
+
+
+ |
+ State:
+ |
+
+ |
+
+ |
+
|
#if $len($hostPages) > 1
#end if
#if $hostStart > 0
- <<<
+ <<<
#end if
#if $totalHosts != 0
Hosts #echo $hostStart + 1 # through #echo $hostStart + $hostCount # of $totalHosts
#end if
#if $hostStart + $hostCount < $totalHosts
- >>>
+ >>>
#end if
|
#if $len($hosts) > 0
#for $host in $hosts
@@ -56,7 +73,7 @@
#if $len($hostPages) > 1
#end if
#if $hostStart > 0
- <<<
+ <<<
#end if
#if $totalHosts != 0
Hosts #echo $hostStart + 1 # through #echo $hostStart + $hostCount # of $totalHosts
#end if
#if $hostStart + $hostCount < $totalHosts
- >>>
+ >>>
#end if
diff --git a/www/kojiweb/index.py b/www/kojiweb/index.py
index 9aab8c51..b050481d 100644
--- a/www/kojiweb/index.py
+++ b/www/kojiweb/index.py
@@ -1238,13 +1238,23 @@ def cancelbuild(req, buildID):
mod_python.util.redirect(req, 'buildinfo?buildID=%i' % build['id'])
-def hosts(req, start=None, order='name'):
+def hosts(req, state='enabled', start=None, order='name'):
values = _initValues(req, 'Hosts', 'hosts')
server = _getServer(req)
values['order'] = order
- hosts = server.listHosts()
+ args = {}
+
+ if state == 'enabled':
+ args['enabled'] = True
+ elif state == 'disabled':
+ args['enabled'] = False
+ else:
+ state = 'all'
+ values['state'] = state
+
+ hosts = server.listHosts(**args)
server.multicall = True
for host in hosts: