diff --git a/lib/vagrant-lxc/container.rb b/lib/vagrant-lxc/container.rb index 4d9d347..9c31626 100644 --- a/lib/vagrant-lxc/container.rb +++ b/lib/vagrant-lxc/container.rb @@ -46,7 +46,7 @@ module Vagrant public_key = Vagrant.source_root.join('keys', 'vagrant.pub').expand_path.to_s meta_opts = metadata.fetch('template-opts', {}).merge( '--auth-key' => public_key, - '--cache' => metadata.fetch('rootfs-cache-path') + '--tarball' => metadata.fetch('rootfs-tarball').to_s ) @cli.name = @name diff --git a/spec/unit/container_spec.rb b/spec/unit/container_spec.rb index bf3c96c..b8a0939 100644 --- a/spec/unit/container_spec.rb +++ b/spec/unit/container_spec.rb @@ -36,7 +36,7 @@ describe Vagrant::LXC::Container do let(:base_name) { 'container-name' } let(:suffix) { 'random-suffix' } let(:template_name) { 'template-name' } - let(:rootfs_cache) { '/path/to/cache' } + let(:rootfs_tarball) { '/path/to/cache/rootfs.tar.gz' } let(:target_rootfs) { '/path/to/rootfs' } let(:public_key_path) { Vagrant.source_root.join('keys', 'vagrant.pub').expand_path.to_s } let(:cli) { fire_double('Vagrant::LXC::Container::CLI', :create => true, :name= => true) } @@ -45,7 +45,7 @@ describe Vagrant::LXC::Container do before do SecureRandom.stub(hex: suffix) - subject.create base_name, target_rootfs, 'template-name' => template_name, 'rootfs-cache-path' => rootfs_cache, 'template-opts' => { '--foo' => 'bar'} + subject.create base_name, target_rootfs, 'template-name' => template_name, 'rootfs-tarball' => rootfs_tarball, 'template-opts' => { '--foo' => 'bar'} end it 'creates container with the right arguments' do @@ -54,7 +54,7 @@ describe Vagrant::LXC::Container do template_name, target_rootfs, '--auth-key' => public_key_path, - '--cache' => rootfs_cache, + '--tarball' => rootfs_tarball, '--foo' => 'bar' ) end