summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-03-07 17:50:41 -0800
committerJay Mundrawala <jdmundrawala@gmail.com>2015-03-20 14:38:04 -0700
commitb468cdd64c9f6fc3b89b81f9b6c7ce63f269d3c3 (patch)
treea1045f666dac4b70f15a3149b9bbd38bf1fec245
parent4d3b0e6e37bfbc5e1e1c79621b7e311784bb6490 (diff)
downloadchef-b468cdd64c9f6fc3b89b81f9b6c7ce63f269d3c3.tar.gz
Allow with_os_architecture to figure things out
-rw-r--r--lib/chef/mixin/windows_architecture_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/chef/mixin/windows_architecture_helper.rb b/lib/chef/mixin/windows_architecture_helper.rb
index 65ad042910..a0ac34f627 100644
--- a/lib/chef/mixin/windows_architecture_helper.rb
+++ b/lib/chef/mixin/windows_architecture_helper.rb
@@ -43,6 +43,14 @@ class Chef
end
def with_os_architecture(node)
+ node ||= begin
+ os_arch = ENV['PROCESSOR_ARCHITEW6432'] ||
+ ENV['PROCESSOR_ARCHITECTURE']
+ Hash.new.tap do |n|
+ n[:kernel] = Hash.new
+ n[:kernel][:machine] = os_arch == 'AMD64' ? :x86_64 : :i386
+ end
+ end
wow64_redirection_state = nil
if wow64_architecture_override_required?(node, node_windows_architecture(node))