From e5375715efd8d0fb25c236d897a06923f52f5d15 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Thu, 27 Mar 2014 20:51:44 -0300 Subject: [PATCH] providers/docker: Update driver to docker 0.9 --- plugins/providers/docker/driver.rb | 10 +++++----- test/unit/plugins/providers/docker/driver_spec.rb | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/providers/docker/driver.rb b/plugins/providers/docker/driver.rb index 9a4a39e50..5aea34054 100644 --- a/plugins/providers/docker/driver.rb +++ b/plugins/providers/docker/driver.rb @@ -21,10 +21,10 @@ module VagrantPlugins name = params.fetch(:name) cmd = Array(params.fetch(:cmd)) - run_cmd = %W(docker run -name #{name} -d) + run_cmd = %W(docker run --name #{name} -d) run_cmd += ports.map { |p| ['-p', p.to_s] } run_cmd += volumes.map { |v| ['-v', v.to_s] } - run_cmd += %W(-privileged) if params[:privileged] + run_cmd += %W(--privileged) if params[:privileged] run_cmd += %W(-h #{params[:hostname]}) if params[:hostname] run_cmd += [image, cmd] @@ -45,12 +45,12 @@ module VagrantPlugins end def created?(cid) - result = execute('docker', 'ps', '-a', '-q', '-notrunc').to_s + result = execute('docker', 'ps', '-a', '-q', '--no-trunc').to_s result =~ /^#{Regexp.escape cid}$/ end def running?(cid) - result = execute('docker', 'ps', '-q', '-notrunc') + result = execute('docker', 'ps', '-q', '--no-trunc') result =~ /^#{Regexp.escape cid}$/m end @@ -87,7 +87,7 @@ module VagrantPlugins end def all_containers - execute('docker', 'ps', '-a', '-q', '-notrunc').to_s.split + execute('docker', 'ps', '-a', '-q', '--no-trunc').to_s.split end def docker_bridge_ip diff --git a/test/unit/plugins/providers/docker/driver_spec.rb b/test/unit/plugins/providers/docker/driver_spec.rb index b057d0d0e..c41bb3924 100644 --- a/test/unit/plugins/providers/docker/driver_spec.rb +++ b/test/unit/plugins/providers/docker/driver_spec.rb @@ -184,7 +184,7 @@ describe VagrantPlugins::DockerProvider::Driver do before { subject.stub(execute: containers) } it 'returns an array of all known containers' do - subject.should_receive(:execute).with('docker', 'ps', '-a', '-q', '-notrunc') + subject.should_receive(:execute).with('docker', 'ps', '-a', '-q', '--no-trunc') expect(subject.all_containers).to eq(['container1', 'container2']) end end