Merge pull request #5315 from jimmidyson/non-existent-docker-group

provisioners/docker: only add user to docker group if docker group exists
This commit is contained in:
Mitchell Hashimoto 2015-02-24 09:45:03 -08:00
commit 734b0d6695
1 changed files with 1 additions and 1 deletions

View File

@ -7,7 +7,7 @@ module VagrantPlugins
ssh_info = machine.ssh_info ssh_info = machine.ssh_info
machine.communicate.tap do |comm| machine.communicate.tap do |comm|
if !comm.test("id -Gn | grep docker") if comm.test("getent group docker") && !comm.test("id -Gn | grep docker")
comm.sudo("usermod -a -G docker #{ssh_info[:username]}") comm.sudo("usermod -a -G docker #{ssh_info[:username]}")
end end
end end