mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 19:10:07 -03:30
fixing module name, json blob, and stdout-for-yum-module on host event
This commit is contained in:
parent
8ce09d1b6d
commit
655ddca1d3
@ -18,6 +18,10 @@
|
||||
<div class="HostEvent-field">
|
||||
<span class="HostEvent-field--label">CREATED</span>
|
||||
<span class="HostEvent-field--content">{{(event.created | longDate) || "No result found"}}</span>
|
||||
</div>
|
||||
<div class="HostEvent-field">
|
||||
<span class="HostEvent-field--label">ID</span>
|
||||
<span class="HostEvent-field--content">{{event.id || "No result found"}}</span>
|
||||
</div>
|
||||
<div class="HostEvent-field">
|
||||
<span class="HostEvent-field--label">PLAY</span>
|
||||
@ -29,7 +33,7 @@
|
||||
</div>
|
||||
<div class="HostEvent-field">
|
||||
<span class="HostEvent-field--label">MODULE</span>
|
||||
<span class="HostEvent-field--content">{{event.event_data.res.invocation.module_name || "No result found"}}</span>
|
||||
<span class="HostEvent-field--content">{{module_name}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -48,17 +48,23 @@
|
||||
hostEvent.event_name = hostEvent.event;
|
||||
$scope.event = _.cloneDeep(hostEvent);
|
||||
$scope.hostResults = hostResults;
|
||||
$scope.json = JobDetailService.processJson(hostEvent);
|
||||
|
||||
// grab standard out & standard error if present from the host
|
||||
// event's "res" object, for things like Ansible modules
|
||||
try{
|
||||
$scope.module_name = hostEvent.event_data.res.invocation.module_name || hostEvent.event_data.res.task_action || "No result found";
|
||||
$scope.stdout = hostEvent.event_data.res.stdout;
|
||||
$scope.stderr = hostEvent.event_data.res.stderr;
|
||||
$scope.json = hostEvent.event_data.res;
|
||||
}
|
||||
catch(err){
|
||||
// do nothing, no stdout/stderr for this module
|
||||
}
|
||||
if($scope.module_name === "yum" &&
|
||||
hostEvent.event_data.res.hasOwnProperty('results') &&
|
||||
_.isArray(hostEvent.event_data.res.results)){
|
||||
$scope.stdout = hostEvent.event_data.res.results[0];
|
||||
}
|
||||
// instantiate Codemirror
|
||||
// try/catch pattern prevents the abstract-state controller from complaining about element being null
|
||||
if ($state.current.name === 'jobDetail.host-event.json'){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user