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
# @return [String]
#
def arch
if Ohai['platform'] == 'windows'
Config.windows_arch
if (Ohai['platform'] == 'windows') && (Config.windows_arch == :x86)
'i386'
else
Ohai['kernel']['machine']
end
......
......@@ -30,12 +30,12 @@ module Omnibus
end
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|
data['kernel']['machine'] = 'x86_64'
end
allow(Config).to receive(:windows_arch).and_return('some_arch')
expect(described_class.arch).to eq('some_arch')
expect(Config).to receive(:windows_arch).and_return(:x86)
expect(described_class.arch).to eq('i386')
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