mirror of
https://github.com/inspec/inspec
synced 2025-02-17 14:38:43 +00:00
Merge pull request #337 from chef/dr/reload-dsl
Fix custom resource loading from `libraries`
This commit is contained in:
commit
246ae0eca5
2 changed files with 7 additions and 2 deletions
|
@ -19,11 +19,15 @@ module Inspec
|
||||||
@profile_id = profile_id
|
@profile_id = profile_id
|
||||||
@rules = profile_registry
|
@rules = profile_registry
|
||||||
@only_ifs = only_ifs
|
@only_ifs = only_ifs
|
||||||
|
@backend = backend
|
||||||
|
|
||||||
dsl = create_inner_dsl(backend)
|
reload_dsl
|
||||||
|
end
|
||||||
|
|
||||||
|
def reload_dsl
|
||||||
|
dsl = create_inner_dsl(@backend)
|
||||||
outer_dsl = create_outer_dsl(dsl)
|
outer_dsl = create_outer_dsl(dsl)
|
||||||
ctx = create_context(outer_dsl)
|
ctx = create_context(outer_dsl)
|
||||||
|
|
||||||
@profile_context = ctx.new
|
@profile_context = ctx.new
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,7 @@ module Inspec
|
||||||
ctx = create_context
|
ctx = create_context
|
||||||
libs.each do |lib|
|
libs.each do |lib|
|
||||||
ctx.load(lib[:content].to_s, lib[:ref], lib[:line] || 1)
|
ctx.load(lib[:content].to_s, lib[:ref], lib[:line] || 1)
|
||||||
|
ctx.reload_dsl
|
||||||
end
|
end
|
||||||
|
|
||||||
# evaluate the test content
|
# evaluate the test content
|
||||||
|
|
Loading…
Add table
Reference in a new issue