Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def delete_package_blob(logger, desc, package)
end

def validate_tgz(logger, tgz, desc)
result = Bosh::Common::Exec.sh("tar -tzf #{tgz} 2>&1", on_error: :return)
result = Bosh::Common::Exec.sh("tar -tf #{tgz} 2>&1", on_error: :return)
if result.failed?
logger.error("Extracting #{desc} archive failed, tar returned #{result.exit_status}, output: #{result.output}")
raise PackageInvalidArchive, "Extracting #{desc} archive failed. Check task debug log for details."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def persist_packages(manifest_packages, compiled_flag)
['fake-name-1.tgz', 'fake-name-2.tgz'].each do |name|
tgz = "#{release_dir}/compiled_packages/#{name}"
allow(Bosh::Common::Exec).to receive(:sh).with(
"tar -tzf #{tgz} 2>&1",
"tar -tf #{tgz} 2>&1",
on_error: :return,
).and_return(instance_double(Bosh::Common::Exec::Result, failed?: false))
expect(BlobUtil).to receive(:create_blob).with(tgz).and_return(1)
Expand Down Expand Up @@ -167,7 +167,7 @@ def persist_packages(manifest_packages, compiled_flag)
['fake-name-2.tgz'].each do |name|
tgz = "#{release_dir}/compiled_packages/#{name}"
allow(Bosh::Common::Exec).to receive(:sh).with(
"tar -tzf #{tgz} 2>&1",
"tar -tf #{tgz} 2>&1",
on_error: :return,
).and_return(instance_double(Bosh::Common::Exec::Result, failed?: false))
expect(BlobUtil).to receive(:create_blob).with(tgz).and_return(1)
Expand Down Expand Up @@ -203,7 +203,7 @@ def persist_packages(manifest_packages, compiled_flag)
['fake-name-1.tgz', 'fake-name-2.tgz'].each do |name|
tgz = "#{release_dir}/compiled_packages/#{name}"
allow(Bosh::Common::Exec).to receive(:sh).with(
"tar -tzf #{tgz} 2>&1",
"tar -tf #{tgz} 2>&1",
on_error: :return,
).and_return(instance_double(Bosh::Common::Exec::Result, failed?: false))
end
Expand Down Expand Up @@ -261,7 +261,7 @@ def persist_packages(manifest_packages, compiled_flag)
it "creates packages that don't already exist" do
tgz = "#{release_dir}/packages/fake-name-2.tgz"
allow(Bosh::Common::Exec).to receive(:sh).with(
"tar -tzf #{tgz} 2>&1",
"tar -tf #{tgz} 2>&1",
on_error: :return,
).and_return(instance_double(Bosh::Common::Exec::Result, failed?: false))
expect(BlobUtil).to receive(:create_blob).with(tgz).and_return(1)
Expand Down
Loading