summaryrefslogtreecommitdiff
path: root/lib/chef/resource_builder.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/resource_builder.rb')
-rw-r--r--lib/chef/resource_builder.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/chef/resource_builder.rb b/lib/chef/resource_builder.rb
index 7d2184c06a..1469514ac3 100644
--- a/lib/chef/resource_builder.rb
+++ b/lib/chef/resource_builder.rb
@@ -1,6 +1,6 @@
#
# Author:: Lamont Granquist (<lamont@chef.io>)
-# Copyright:: Copyright 2015-2017, Chef Software Inc.
+# Copyright:: Copyright 2015-2020, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -73,6 +73,14 @@ class Chef
# Run optional resource hook
resource.after_created
+ # Force to compile_time execution if the flag is set
+ if resource.compile_time
+ Array(resource.action).each do |action|
+ resource.run_action(action)
+ end
+ resource.action :nothing
+ end
+
resource
end