Fixed error with empty shell provisioner
`read` returns nil on empty files, so the call to `valid_encoding` fails.
This commit is contained in:
parent
9529dd8cde
commit
247a2470c0
|
@ -53,7 +53,7 @@ module VagrantPlugins
|
||||||
:path => expanded_path)
|
:path => expanded_path)
|
||||||
else
|
else
|
||||||
data = expanded_path.read(16)
|
data = expanded_path.read(16)
|
||||||
if !data.valid_encoding?
|
if data != nil && !data.valid_encoding?
|
||||||
errors << I18n.t(
|
errors << I18n.t(
|
||||||
"vagrant.provisioners.shell.invalid_encoding",
|
"vagrant.provisioners.shell.invalid_encoding",
|
||||||
actual: data.encoding.to_s,
|
actual: data.encoding.to_s,
|
||||||
|
|
Loading…
Reference in New Issue