Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Duplicate
-
Affects Version/s: 0.7.10, 0.7.12, 0.7.14, 0.7.16, 0.8.2
-
Fix Version/s: None
-
Component/s: Chef Solo
-
Labels:None
Description
In load_current_resource when copying instance variables, chef is not excluding @not_if and @only_if. These being copied results in unexpected behavior from multiple copies of a resource inheriting not_if conditionals.
proposed fix is change this line: http://github.com/opscode/chef/blob/master/chef/lib/chef/resource.rb#L81
to read: unless iv == "@source_line" || iv == "@action" || iv == "@not_if" || iv == "@only_if"
here's an example of unexpected behavior:
service "mysql" do
not_if do true end
action :start
end
service "mysql" do # does not run, without not_if do false end; to override the copy.
action :start
end
Issue Links
- duplicates
-
CHEF-2812
0.10.4 -> 0.10.6 regression when reloading prior state from resources
-
Activity
- All
- Comments
- History
- Activity
- Transitions Summary
A more recent and fuller discussion of inheritance of not_if and only_if is on
CHEF-2812, so I'm going to close this bug as a duplicate of that one to keep the conversation in one place.