mirror of
https://github.com/inspec/inspec
synced 2024-11-23 13:13:22 +00:00
restrict mount functionality to linux
This commit is contained in:
parent
7e7cf5a724
commit
9930773f37
2 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue