From 773548551dffc195f96329fe9c61df5d38c17f6c Mon Sep 17 00:00:00 2001 From: Dominik Richter Date: Fri, 25 Sep 2015 01:16:39 +0200 Subject: [PATCH] bugfix: specinfra file handling on bsd over ssh Signed-off-by: Dominik Richter --- lib/vulcano/backend/specinfra.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/vulcano/backend/specinfra.rb b/lib/vulcano/backend/specinfra.rb index 56cc05129..9a1a15584 100644 --- a/lib/vulcano/backend/specinfra.rb +++ b/lib/vulcano/backend/specinfra.rb @@ -251,7 +251,7 @@ module Vulcano::Backends def content 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 else s @@ -272,13 +272,13 @@ module Vulcano::Backends def mtime 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 end def size 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 end