From a2b91eaa1ecf41ff4bc460841617b49237ee87d8 Mon Sep 17 00:00:00 2001 From: Mike Bonnet Date: Tue, 21 Sep 2010 11:13:26 -0400 Subject: [PATCH] enable selection of Windows tasks on the Tasks page --- hub/hub.conf | 6 ++++++ hub/kojihub.py | 3 +++ www/kojiweb/index.py | 7 +++++-- www/kojiweb/tasks.chtml | 4 ++++ www/lib/kojiweb/util.py | 2 ++ 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/hub/hub.conf b/hub/hub.conf index 660933cb..e4ee61fd 100644 --- a/hub/hub.conf +++ b/hub/hub.conf @@ -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 diff --git a/hub/kojihub.py b/hub/kojihub.py index f950a811..a240a58c 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -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 diff --git a/www/kojiweb/index.py b/www/kojiweb/index.py index 82c3f531..8e9bb47e 100644 --- a/www/kojiweb/index.py +++ b/www/kojiweb/index.py @@ -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') diff --git a/www/kojiweb/tasks.chtml b/www/kojiweb/tasks.chtml index 75837225..d08740c0 100644 --- a/www/kojiweb/tasks.chtml +++ b/www/kojiweb/tasks.chtml @@ -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 #end if diff --git a/www/lib/kojiweb/util.py b/www/lib/kojiweb/util.py index 3e41faa6..0a1db5c8 100644 --- a/www/lib/kojiweb/util.py +++ b/www/lib/kojiweb/util.py @@ -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: