#macro printChildren(taskID, childMap) #set children = childMap[taskID|string] #if children #endif #endmacro #macro printMap(vals, prefix='') #for key, value in vals.items() #if key == 'properties' {{ prefix }}properties = {{ printProperties(value) }}
#elif key != '__starstar' {{ prefix }}{{ key }} = {{ printValue(key, value) }}
#endif #endfor #endmacro #macro printOpts(opts) #if opts Options:
{{ printMap(opts, S('  ')) }} #endif #endmacro #macro 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 value is mapping {{ value.id }} ({{ koji.formatTimeLong(value.create_ts) }}) #elif value is sequence and value is not string {{ value|join(sep) }} #else {{ value }} #endif #elif key == 'task_list' #for task in params['task_list']
 Task:
{{ printMap(task, S('  ')) }} #endfor #elif value is mapping {{ printSimpleMap(value, sep) }} #elif value is sequence and value is not string {{ value|join(sep) }} #else {{ value }} #endif #endmacro {%- macro printSimpleMap(value, sep) %} {%- for name, value in value|dictsort -%} {{- '%s=%s' % ("''" if name == '' else name, value) -}} {{- sep if not loop.last else '' -}} {%- endfor -%} {%- endmacro %} #macro printProperties(props) ## TODO this needs refactoring, but for now we simply port the logic {%- for name, value in props|dictsort -%} {{- name if value is none else '%s=%s' % (name, value) -}} {{- ', ' if not loop.last else '' -}} {%- endfor -%} #endmacro #include "header.html.j2"

Information for task {{ koji.taskLabel(task) }}

#set state = util.taskState(task.state) #if taskBuilds #for build in taskBuilds #endfor #endif #if requests #endif #if task.start_time #endif #set end_ts = None #if task.state == koji.TASK_STATES.OPEN #if estCompletion #endif #elif task.completion_time #set end_ts = task.completion_ts #endif #if not end_ts #set end_ts = koji.time.time() #endif #if task.start_time #endif #if buildroots #endif
ID{{ task.id }}
Method{{ task.method }}
Parameters #for key in params|sort #if params[key] is not none {{ key | capitalize |replace('_', ' ') }}: {{ printValue(key, params[key]) }}
#endif #endfor {{ 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) #endif #endif #if currentUser and 'admin' in perms and task.state in (koji.TASK_STATES.OPEN, koji.TASK_STATES.ASSIGNED) (free) #endif
Build{{ koji.buildLabel(build) }}
For request: ## we only expect one, but if we get more print them all #for req in requests {{ req.id }} #endfor
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 }} #endif #endif
Channel #if task.channel_id {{ channelName }} #endif
Host #if task.host_id {{ hostName }} #endif
Arch{{ task.arch }}
Buildroot{{ 's' if buildroots|length > 1 else '' }} #for buildroot in buildroots {{ '' if task.method == 'vmExec' else '/var/lib/mock/' }}{{ buildroot.tag_name }}-{{ buildroot.id }}-{{ buildroot.repo_id }}
#endfor
Parent #if parent {{ koji.taskLabel(parent) }} #endif
Descendants #if descendents[task.id|string] #set taskState = util.taskState(task.state) {{ util.imageTag(taskState) }} {{ task.method }} #endif {{ printChildren(task.id, descendents) }}
Waiting?{{ 'yes' if task.waiting else 'no' }}
Awaited?{{ 'yes' if task.awaited else 'no' }}
Priority{{ task.priority }}
Weight{{ '%.2f' % task.weight }}
Result #if abbr_result_text
{{ abbr_result_text }}
{{ full_result_text }}
#else
{{ full_result_text }}
#endif
Output #for pair in output #set volume = pair[0] #set filename = pair[1] {{ filename }} #if filename.endswith('.log') (tail) #endif
#endfor #if not output
No outputs reported
#endif {% 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 {% endif %}
#if abbr_result_text #endif #include "footer.html.j2"