Skip to content

Commit

Permalink
do not stuck during compress if file already exists (bnc#897091)
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Jan 7, 2015
1 parent 522e70c commit dd87e2d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/installation/copy_logs_finish.rb
Expand Up @@ -70,7 +70,7 @@ def write
Yast::Directory.logdir,
target_basename
)
compress_cmd = "gzip #{target_path}"
compress_cmd = "gzip -f #{target_path}"
log.debug "Compress command: #{compress_cmd}"
Yast::WFM.Execute(LOCAL_BASH, compress_cmd)
when /\Ay2log-\d+\.gz\z/
Expand Down
8 changes: 8 additions & 0 deletions test/copy_logs_finish_test.rb
Expand Up @@ -34,6 +34,14 @@
subject.write
end

it "do not stuck during compress if file already exists (bnc#897091)" do
allow(Yast::WFM).to receive(:Read).and_return(["y2log-1"])

expect(Yast::WFM).to receive(:Execute).with(anything(), /gzip -f/)

subject.write
end

it "rotate zypp.log" do
allow(Yast::WFM).to receive(:Read).and_return(["zypp.log"])

Expand Down

0 comments on commit dd87e2d

Please sign in to comment.