RunCommandLogs: add a did_succeed helper

This commit is contained in:
Graham Christensen
2021-11-18 14:27:00 -05:00
parent 5bb3e2be78
commit d003fec8a5
4 changed files with 29 additions and 0 deletions

View File

@ -228,5 +228,27 @@ sub completed_with_child_error {
});
}
=head2 did_succeed
Return:
* true if the task ran and finished successfully,
* false if the task did not run successfully but is completed
* undef if the task has not yet run
=cut
sub did_succeed {
my ($self) = @_;
if (!defined($self->end_time)) {
return undef;
}
if (!defined($self->exit_code)) {
return 0;
}
return $self->exit_code == 0;
}
1;