bugfix: specinfra file handling on bsd over ssh

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
This commit is contained in:
Dominik Richter 2015-09-25 01:16:39 +02:00
parent 3858606fb7
commit 773548551d

View file

@ -251,7 +251,7 @@ module Vulcano::Backends
def content def content
s = Specinfra::Runner.get_file_content(@path).stdout s = Specinfra::Runner.get_file_content(@path).stdout
if s.empty? && (directory? or size.nil? or size > 0) if s.empty? && (directory? or (size || 0) > 0 or !exist?)
nil nil
else else
s s
@ -272,13 +272,13 @@ module Vulcano::Backends
def mtime def mtime
mt = Specinfra::Runner.get_file_mtime(@path).stdout.strip mt = Specinfra::Runner.get_file_mtime(@path).stdout.strip
return nil if mt.empty? || mt.include?('cannot stat') return nil if mt.empty? || mt.include?(' ')
mt.to_i mt.to_i
end end
def size def size
s = Specinfra::Runner.get_file_size(@path).stdout.strip s = Specinfra::Runner.get_file_size(@path).stdout.strip
return nil if s.empty? || s.include?('cannot stat') return nil if s.empty? || s.include?(' ')
s.to_i s.to_i
end end