mirror of
https://github.com/inspec/inspec
synced 2024-12-18 00:53:22 +00:00
bugfix: specinfra file handling on bsd over ssh
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
This commit is contained in:
parent
3858606fb7
commit
773548551d
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue