summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2017-02-26 16:13:38 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2017-02-28 11:19:49 -0800
commitccc373354e02db91ef00a6d8d7bab520c7ebc3ab (patch)
tree7b5b9a2020ee4495789801ce29ec14af7c6df181
parent8f2cdc75307dfba5d3867d0794dc6085795dc36f (diff)
downloadchef-ccc373354e02db91ef00a6d8d7bab520c7ebc3ab.tar.gz
Chef-13: Remove Chef::PolicyBuilder::ExpandNodeObject#load_node
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--RELEASE_NOTES.md4
-rw-r--r--lib/chef/policy_builder/expand_node_object.rb29
-rw-r--r--spec/unit/policy_builder/expand_node_object_spec.rb8
3 files changed, 7 insertions, 34 deletions
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 374396ae9a..12c3fd8a8d 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -37,3 +37,7 @@ The remediation is to set the manage_home and non_unique properties directly.
Without a declared cwd the relative path was (most likely?) relative to wherever chef-client happened to be invoked which is
not deterministic or easy to intuit behavior.
+### Chef::PolicyBuilder::ExpandNodeObject#load_node has been removed
+
+This change is most likely to only affect internals of tooling like chefspec if it affects anything at all.
+
diff --git a/lib/chef/policy_builder/expand_node_object.rb b/lib/chef/policy_builder/expand_node_object.rb
index d8f4f752de..dbed44a002 100644
--- a/lib/chef/policy_builder/expand_node_object.rb
+++ b/lib/chef/policy_builder/expand_node_object.rb
@@ -3,7 +3,7 @@
# Author:: Tim Hinderliter (<tim@chef.io>)
# Author:: Christopher Walters (<cw@chef.io>)
# Author:: Daniel DeLeo (<dan@chef.io>)
-# Copyright:: Copyright 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright 2008-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -103,33 +103,6 @@ class Chef
run_context
end
- # DEPRECATED: As of Chef 12.5, chef selects either policyfile mode or
- # "expand node" mode dynamically, based on the content of the node
- # object, first boot JSON, and config. This happens in
- # PolicyBuilder::Dynamic, which selects the implementation during
- # #load_node and then delegates to either ExpandNodeObject or Policyfile
- # implementations as appropriate. Tools authors should update their code
- # to create a PolicyBuilder::Dynamc policy builder and allow it to select
- # the proper implementation.
- def load_node
- Chef.deprecated(:internal_api, "ExpandNodeObject#load_node is deprecated. Please use Chef::PolicyBuilder::Dynamic instead of using ExpandNodeObject directly")
-
- events.node_load_start(node_name, config)
- Chef::Log.debug("Building node object for #{node_name}")
-
- @node =
- if Chef::Config[:solo_legacy_mode]
- Chef::Node.build(node_name)
- else
- Chef::Node.find_or_create(node_name)
- end
- finish_load_node(node)
- node
- rescue Exception => e
- events.node_load_failed(node_name, e, config)
- raise
- end
-
def finish_load_node(node)
@node = node
end
diff --git a/spec/unit/policy_builder/expand_node_object_spec.rb b/spec/unit/policy_builder/expand_node_object_spec.rb
index 420db2e855..68b3c285a1 100644
--- a/spec/unit/policy_builder/expand_node_object_spec.rb
+++ b/spec/unit/policy_builder/expand_node_object_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Daniel DeLeo (<dan@chef.io>)
-# Copyright:: Copyright 2014-2016, Chef Software, Inc.
+# Copyright:: Copyright 2014-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -34,11 +34,7 @@ describe Chef::PolicyBuilder::ExpandNodeObject do
expect(policy_builder).to respond_to(:node)
end
- it "implements a load_node method for backwards compatibility until Chef 13" do
- expect(policy_builder).to respond_to(:load_node)
- end
-
- it "has removed the deprecated #load_node method", chef: ">= 13" do
+ it "has removed the deprecated #load_node method" do
expect(policy_builder).to_not respond_to(:load_node)
end