restrict mount functionality to linux

This commit is contained in:
Christoph Hartmann 2016-01-02 22:57:52 +01:00
parent 7e7cf5a724
commit 9930773f37
2 changed files with 4 additions and 0 deletions

View file

@ -65,6 +65,9 @@ module Inspec::Resources
# return if no additional parameters have been provided
return file.mounted? if expected_options.nil?
# we cannot read mount data on non-Linux systems
return nil if !inspec.os.linux?
# parse content if we are on linux
@mount_options ||= parse_mount_options(mounted.stdout, true)

View file

@ -21,6 +21,7 @@ class Mount < Inspec.resource(1)
def initialize(path)
@path = path
return skip_resource 'The `mount` resource is not supported on your OS yet.' if !inspec.os.linux?
@file = inspec.backend.file(@path)
end