RunCommand: use helper functions to ensure filenames and paths are the same
Otherwise, it's possible someone updates the format in one place but not the others, leading to broken or incorrect functionality.
This commit is contained in:
@ -140,7 +140,7 @@ sub view_log : Chained('buildChain') PathPart('log') {
|
||||
sub view_runcommand_log : Chained('buildChain') PathPart('runcommand-log') {
|
||||
my ($self, $c, $sha) = @_;
|
||||
|
||||
$c->stash->{log_uri} = $c->uri_for($c->controller('Root')->action_for("runcommandlog"), $sha . "-" . $c->stash->{build}->id);
|
||||
$c->stash->{log_uri} = $c->uri_for($c->controller('Root')->action_for("runcommandlog"), constructRunCommandLogFilename($sha, $c->stash->{build}->id));
|
||||
$c->stash->{template} = 'runcommand-log.tt';
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,6 @@ use base 'Hydra::Base::Controller::ListBuilds';
|
||||
use Hydra::Helper::Nix;
|
||||
use Hydra::Helper::CatalystUtils;
|
||||
use Hydra::View::TT;
|
||||
use Hydra::Model::DB;
|
||||
use Nix::Store;
|
||||
use Nix::Config;
|
||||
use Encode;
|
||||
@ -538,7 +537,7 @@ sub runcommandlog :Local :Args(1) {
|
||||
|
||||
die if defined $tail && $tail !~ /^[0-9]+$/;
|
||||
|
||||
my $logFile = Hydra::Model::DB::getHydraPath . "/runcommand-logs/" . substr($filename, 0, 2) . "/$filename";
|
||||
my $logFile = constructRunCommandLogPath($filename);
|
||||
if (-f $logFile) {
|
||||
serveLogFile($c, $logFile, $tail);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user