Commit c2c00575 authored by Seth Chisamore's avatar Seth Chisamore

`Metadata#arch` should return a valid Ohai architecture

The change introduced in #535 began returning architecture values of 
`:x86` and `:x64` on Windows. We would prefer the `*.metadata.json` 
files contain valid Ohai-based values of `i386` or `x86_64` as we use 
this data when publishing to backend systems like Artifactory. This 
saves unnecessary translation when fetching packages at install time.
parent 7232cbcb
...@@ -108,8 +108,8 @@ module Omnibus ...@@ -108,8 +108,8 @@ module Omnibus
# @return [String] # @return [String]
# #
def arch def arch
if Ohai['platform'] == 'windows' if (Ohai['platform'] == 'windows') && (Config.windows_arch == :x86)
Config.windows_arch 'i386'
else else
Ohai['kernel']['machine'] Ohai['kernel']['machine']
end end
...@@ -30,12 +30,12 @@ module Omnibus ...@@ -30,12 +30,12 @@ module Omnibus
end end
context 'on windows' do context 'on windows' do
it 'returns the value of Config.windows_arch' do it 'returns a 32-bit value based on Config.windows_arch being set to x86' do
stub_ohai(platform: 'windows', version: '2012R2') do |data| stub_ohai(platform: 'windows', version: '2012R2') do |data|
data['kernel']['machine'] = 'x86_64' data['kernel']['machine'] = 'x86_64'
end end
allow(Config).to receive(:windows_arch).and_return('some_arch') expect(Config).to receive(:windows_arch).and_return(:x86)
expect(described_class.arch).to eq('some_arch') expect(described_class.arch).to eq('i386')
end end
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment