summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-07-06 16:19:06 -0700
committerTim Smith <tsmith@chef.io>2018-07-06 16:19:06 -0700
commite7f8f91bd5dd7ac8e1655a645a410e56d7625877 (patch)
treebfa1fce247ae783866e18f039289c8702ab7fde7
parent71d6ffa5a7aba4187b724179f8f0004d274a7c33 (diff)
downloadchef-e7f8f91bd5dd7ac8e1655a645a410e56d7625877.tar.gz
Prevent failures using windows_feature due to the platform helper
node isn't available within the helper. Lets use the same hack we use in docker? to pass it in automatically. Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/platform/query_helpers.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/platform/query_helpers.rb b/lib/chef/platform/query_helpers.rb
index 448885dfbc..b267d9dbb3 100644
--- a/lib/chef/platform/query_helpers.rb
+++ b/lib/chef/platform/query_helpers.rb
@@ -22,7 +22,7 @@ class Chef
class << self
# a simple helper to determine if we're on a windows release pre-2012 / 8
# @return [Boolean] Is the system older than Windows 8 / 2012
- def older_than_win_2012_or_8?
+ def older_than_win_2012_or_8?(node = run_context.nil? ? nil : run_context.node)
node["platform_version"].to_f < 6.2
end