Merge branch 'unpriv_shell' of https://github.com/frsantos/vagrant into frsantos-unpriv_shell
Conflicts: plugins/provisioners/shell/config.rb plugins/provisioners/shell/provisioner.rb
This commit is contained in:
commit
349b2507f9
|
@ -5,12 +5,14 @@ module VagrantPlugins
|
||||||
attr_accessor :path
|
attr_accessor :path
|
||||||
attr_accessor :upload_path
|
attr_accessor :upload_path
|
||||||
attr_accessor :args
|
attr_accessor :args
|
||||||
|
attr_accessor :privileged
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@args = UNSET_VALUE
|
@args = UNSET_VALUE
|
||||||
@inline = UNSET_VALUE
|
@inline = UNSET_VALUE
|
||||||
@path = UNSET_VALUE
|
@path = UNSET_VALUE
|
||||||
@upload_path = UNSET_VALUE
|
@upload_path = UNSET_VALUE
|
||||||
|
@privileged = UNSET_VALUE
|
||||||
end
|
end
|
||||||
|
|
||||||
def finalize!
|
def finalize!
|
||||||
|
@ -18,6 +20,7 @@ module VagrantPlugins
|
||||||
@inline = nil if @inline == UNSET_VALUE
|
@inline = nil if @inline == UNSET_VALUE
|
||||||
@path = nil if @path == UNSET_VALUE
|
@path = nil if @path == UNSET_VALUE
|
||||||
@upload_path = "/tmp/vagrant-shell" if @upload_path == UNSET_VALUE
|
@upload_path = "/tmp/vagrant-shell" if @upload_path == UNSET_VALUE
|
||||||
|
@privileged = true if @privileged == UNSET_VALUE
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate(machine)
|
def validate(machine)
|
||||||
|
|
|
@ -28,7 +28,7 @@ module VagrantPlugins
|
||||||
end
|
end
|
||||||
|
|
||||||
# Execute it with sudo
|
# Execute it with sudo
|
||||||
comm.sudo(command) do |type, data|
|
comm.execute(command, sudo: config.privileged) do |type, data|
|
||||||
if [:stderr, :stdout].include?(type)
|
if [:stderr, :stdout].include?(type)
|
||||||
# Output the data with the proper color based on the stream.
|
# Output the data with the proper color based on the stream.
|
||||||
color = type == :stdout ? :green : :red
|
color = type == :stdout ? :green : :red
|
||||||
|
|
Loading…
Reference in New Issue