enable selection of Windows tasks on the Tasks page

This commit is contained in:
Mike Bonnet 2010-09-21 11:13:26 -04:00
parent 2e0defc4a7
commit a2b91eaa1e
5 changed files with 20 additions and 2 deletions

View file

@ -49,6 +49,12 @@ NotifyOnSuccess = True
## Disables all notifications
# DisableNotifications = False
## Extended features
## Support Maven builds
# EnableMaven = False
## Support Windows builds
# EnableWin = False
## Koji hub plugins
## The path where plugins are found
# PluginPath = /usr/lib/koji-hub-plugins

View file

@ -6305,6 +6305,9 @@ class RootExports(object):
def mavenEnabled(self):
return bool(context.opts.get('EnableMaven'))
def winEnabled(self):
return bool(context.opts.get('EnableWin'))
def showSession(self):
return "%s" % context.session

View file

@ -359,6 +359,9 @@ _TASKS = ['build',
'chainbuild',
'maven',
'buildMaven',
'wrapperRPM',
'winbuild',
'vmExec',
'waitrepo',
'tagBuild',
'newRepo',
@ -369,9 +372,9 @@ _TASKS = ['build',
'createLiveCD',
'createAppliance']
# Tasks that can exist without a parent
_TOPLEVEL_TASKS = ['build', 'buildNotification', 'chainbuild', 'maven', 'newRepo', 'tagBuild', 'tagNotification', 'waitrepo', 'createLiveCD', 'createAppliance']
_TOPLEVEL_TASKS = ['build', 'buildNotification', 'chainbuild', 'maven', 'wrapperRPM', 'winbuild', 'newRepo', 'tagBuild', 'tagNotification', 'waitrepo', 'createLiveCD', 'createAppliance']
# Tasks that can have children
_PARENT_TASKS = ['build', 'chainbuild', 'maven', 'newRepo']
_PARENT_TASKS = ['build', 'chainbuild', 'maven', 'winbuild', 'newRepo']
def tasks(req, owner=None, state='active', view='tree', method='all', hostID=None, start=None, order='-id'):
values = _initValues(req, 'Tasks', 'tasks')

View file

@ -81,6 +81,10 @@ All
#for $task_type in $alltasks
#if $task_type in ('maven', 'buildMaven') and not $mavenEnabled
#continue
#elif $task_type in ('winbuild', 'vmExec') and not $winEnabled
#continue
#elif $task_type == 'wrapperRPM' and not ($mavenEnabled or $winEnabled)
#continue
#else
<option value="$task_type" #if $method == $task_type then 'selected="selected"' else ''#>$task_type</option>
#end if

View file

@ -67,6 +67,8 @@ def _genHTML(req, fileName):
req._values['authToken'] = _genToken(req)
if not req._values.has_key('mavenEnabled'):
req._values['mavenEnabled'] = req._session.mavenEnabled()
if not req._values.has_key('winEnabled'):
req._values['winEnabled'] = req._session.winEnabled()
tmpl_class = TEMPLATES.get(fileName)
if not tmpl_class: