mirror of
https://github.com/inspec/inspec
synced 2025-02-17 06:28:40 +00:00
Merge pull request #4550 from inspec/zenspider/only_if/os
Add no-op resource and switch Rule to use it for skipped resources.
This commit is contained in:
commit
d7e39c38f9
2 changed files with 10 additions and 3 deletions
9
lib/inspec/resources/noop.rb
Normal file
9
lib/inspec/resources/noop.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
module Inspec::Resources
|
||||
class Noop < Inspec.resource(1)
|
||||
name "noop"
|
||||
|
||||
def to_s
|
||||
"No-op"
|
||||
end
|
||||
end
|
||||
end
|
|
@ -227,9 +227,7 @@ module Inspec
|
|||
msg = "Skipped control due to #{skip_check[:type]} condition."
|
||||
end
|
||||
|
||||
# TODO: we use os as the carrier here, but should consider
|
||||
# a separate resource to do skipping
|
||||
resource = rule.os
|
||||
resource = rule.noop
|
||||
resource.skip_resource(msg)
|
||||
[["describe", [resource], nil]]
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue