HACK: Redirect rootfs extraction stderr to /dev/null as repackaged containers will output a lot of stuff (but it will still work fine :)

This commit is contained in:
Fabio Rehm 2013-03-30 19:23:06 -03:00
parent 23bb2e0733
commit edec52f004
2 changed files with 3 additions and 2 deletions

View file

@ -29,7 +29,8 @@ module Vagrant
system(%Q[sudo su root -c "cp #{lxc_template_src} #{dest}"])
@logger.debug('Extracting rootfs')
system(%Q[sudo su root -c "cd #{box.directory} && tar xfz rootfs.tar.gz -C #{rootfs_cache}"])
# TODO: Ideally the compressed rootfs should not output errors...
system(%Q[sudo su root -c "cd #{box.directory} && tar xfz rootfs.tar.gz -C #{rootfs_cache} 2>/dev/null"])
box.metadata.merge!(
'template-name' => template_name,

View file

@ -39,6 +39,6 @@ describe Vagrant::LXC::Action::HandleBoxMetadata do
it 'extracts rootfs into a tmp folder' do
subject.should have_received(:system).
with(%Q[sudo su root -c "cd #{box_directory} && tar xfz rootfs.tar.gz -C #{tmpdir}"])
with(%Q[sudo su root -c "cd #{box_directory} && tar xfz rootfs.tar.gz -C #{tmpdir} 2>/dev/null"])
end
end