summaryrefslogtreecommitdiff
path: root/lib/chef/resource
diff options
context:
space:
mode:
authorClaire McQuin <claire@getchef.com>2015-10-02 15:14:29 -0700
committerClaire McQuin <claire@getchef.com>2015-10-05 10:00:07 -0700
commite413ea35bba2ad36453b3d428c343ab3f0bce23a (patch)
tree2114f4b54a99337f67e66b46f7f172d49c6a5313 /lib/chef/resource
parent69cf21c8b35d7fb94775db377e810908e5fad54a (diff)
downloadchef-e413ea35bba2ad36453b3d428c343ab3f0bce23a.tar.gz
Raise error when running 32-bit scripts on Windows Nano.mcquin/nano/disable-32-bit
Diffstat (limited to 'lib/chef/resource')
-rw-r--r--lib/chef/resource/windows_script.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/chef/resource/windows_script.rb b/lib/chef/resource/windows_script.rb
index 48e2b535a8..2bbd01d5aa 100644
--- a/lib/chef/resource/windows_script.rb
+++ b/lib/chef/resource/windows_script.rb
@@ -16,6 +16,7 @@
# limitations under the License.
#
+require 'chef/platform/query_helpers'
require 'chef/resource/script'
require 'chef/mixin/windows_architecture_helper'
@@ -51,9 +52,12 @@ class Chef
protected
def assert_architecture_compatible!(desired_architecture)
- if ! node_supports_windows_architecture?(node, desired_architecture)
+ if desired_architecture == :i386 && Chef::Platform.windows_nano_server?
raise Chef::Exceptions::Win32ArchitectureIncorrect,
- "cannot execute script with requested architecture '#{desired_architecture.to_s}' on a system with architecture '#{node_windows_architecture(node)}'"
+ "cannot execute script with requested architecture 'i386' on Windows Nano Server"
+ elsif ! node_supports_windows_architecture?(node, desired_architecture)
+ raise Chef::Exceptions::Win32ArchitectureIncorrect,
+ "cannot execute script with requested architecture '#{desired_architecture.to_s}' on a system with architecture '#{node_windows_architecture(node)}'"
end
end
end