#import koji #import koji.util as kojiutil #from kojiweb import util #from urllib.parse import quote #import datetime #@util.safe_return #def printChildren($taskID, $childMap) #set $iter = 0 #set $children = $childMap[$str($taskID)] #if $children #end if #end def #@util.safe_return #def printMap($vals, $prefix='') #for $key, $value in $vals.items() #if $key == 'properties' ${prefix}properties = $printProperties($value)
#elif $key != '__starstar' $prefix$key = $printValue($key, $value)
#end if #end for #end def #@util.safe_return #def printOpts($opts) #if $opts Options:
$printMap($opts, '  ') #end if #end def #@util.safe_return #def printValue($key, $value, $sep=', ') #if $value is None None #elif $key == 'user' $value['name'] #elif $key == 'task' $value['id'] #elif $key == 'host' $value['name'] #elif $key == 'build' $value['nvr'] #elif $key == 'buildroot' $value['id'] #elif $key in ('tag', 'destination_tag', 'build_tag') $value['name'] #elif $key in ('build_target', 'target_info') $value['name'] #elif $key in ('repo_info', 'oldrepo', 'repo') #if $key == 'repo' and isinstance($value, list) $sep.join([$str($val) for $val in $value]) #else $value.id ($koji.formatTimeLong($value.create_ts)) #end if #elif $key == 'task_list' #for $task in $params['task_list']
 Task:
$printMap($task, '  ') #end for #elif $isinstance($value, list) $sep.join([$str($val) for $val in $value]) #elif $isinstance($value, dict) $sep.join(['%s=%s' % (($n == '' and "''" or $n), $v) for $n, $v in $value.items()]) #else $value #end if #end def #@util.safe_return #def printProperties($props) #echo ', '.join([$v is not None and '%s=%s' % ($n, $v) or $str($n) for $n, $v in $props.items()]) #end def #include "includes/header.chtml"

Information for task $koji.taskLabel($task)

#set $state = $util.taskState($task.state) #if $taskBuilds #for $build in $taskBuilds #end for #end if #if $task.start_time #end if #set $end_ts = None #if $task.state == $koji.TASK_STATES.OPEN #if $estCompletion #end if #elif $task.completion_time #set $end_ts = $task.completion_ts #end if #if not $end_ts #set $end_ts = $kojiutil.parseTime($kojiutil.encode_datetime(datetime.datetime.utcnow())) #end if #if $task.start_time #end if #if $buildroots #end if
ID$task.id
Method$task.method
Parameters #for key in $sorted($params) #if $params[$key] is not None $key.capitalize().replace('_', ' '): $printValue($key, $params[$key])
#end if #end for $printOpts($opts)
State $state #if $currentUser and ('admin' in $perms or $task.owner == $currentUser.id) #if $task.state in ($koji.TASK_STATES.FREE, $koji.TASK_STATES.OPEN, $koji.TASK_STATES.ASSIGNED) (cancel) #elif $task.state in ($koji.TASK_STATES.CANCELED, $koji.TASK_STATES.FAILED) and (not $parent) (resubmit) #end if #end if #if $currentUser and 'admin' in $perms and $task.state in ($koji.TASK_STATES.OPEN, $koji.TASK_STATES.ASSIGNED) (free) #end if
Build$koji.buildLabel($build)
Created$util.formatTimeLong($task.create_ts)
Started$util.formatTimeLong($task.start_ts)
Est. Completion $util.formatTimeLong($estCompletion)
Completed$util.formatTimeLong($task.completion_ts)
Total time $util.formatTimestampDifference($task.create_ts, $end_ts)
Task time $util.formatTimestampDifference($task.start_ts, $end_ts)
Owner #if $owner #if $owner.usertype == $koji.USERTYPES['HOST'] $owner.name #else $owner.name #end if #end if
Channel #if $task.channel_id $channelName #end if
Host #if $task.host_id $hostName #end if
Arch$task.arch
Buildroot#if $len($buildroots) > 1 then 's' else ''# #for $buildroot in $buildroots #if $task.method == 'vmExec' then '' else '/var/lib/mock/'#$buildroot.tag_name-$buildroot.id-$buildroot.repo_id
#end for
Parent #if $parent $koji.taskLabel($parent) #end if
Descendants #if $len($descendents[$str($task.id)]) > 0 #set $taskState = $util.taskState($task.state) $util.imageTag($taskState) $task.method #end if $printChildren($task.id, $descendents)
Waiting?#if $task.waiting then 'yes' else 'no'#
Awaited?#if $task.awaited then 'yes' else 'no'#
Priority$task.priority
Weight#echo '%.2f' % $task.weight#
Result #if $abbr_result_text
$abbr_result_text
$full_result_text
#else
$full_result_text
#end if
Output #for $volume, $filename in $output $filename #if $filename.endswith('.log') (tail) #end if
#end for #if not $output
No outputs reported
#end if #if $task.state not in ($koji.TASK_STATES.CLOSED, $koji.TASK_STATES.CANCELED, $koji.TASK_STATES.FAILED) and \ $task.method in ('buildSRPMFromSCM', 'buildArch', 'createLiveMedia', 'buildMaven', 'wrapperRPM', 'vmExec', 'createrepo', 'runroot', 'createAppliance', 'createLiveCD')
Watch logs #end if
#if $abbr_result_text #end if #include "includes/footer.chtml"