Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert wmic architecture to a normal standard #151

Merged
merged 1 commit into from
Sep 20, 2016
Merged

Convert wmic architecture to a normal standard #151

merged 1 commit into from
Sep 20, 2016

Conversation

jerryaldrichiii
Copy link
Contributor

Windows wmic os get outputs values that are not expected for CPU architecture.

For example, instead of x86_64 or i386 it returns 64-bit and 32-bit

This uses the output of wmic cpu get architecture and converts it to something that is expected from commands like uname or arch.

This is intended to resolve the InSpec issue brought up by @seththoenen here and is an alternative to my InSpec PR here.

@@ -7,6 +7,7 @@
# OHAI https://github.com/chef/ohai
# by Adam Jacob, Chef Software Inc
#
require 'pry'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove pry

Copy link
Contributor Author

@jerryaldrichiii jerryaldrichiii Sep 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 Done!

@chris-rock
Copy link
Contributor

Thanks @jerryaldrichiii this is a really good improvement.

@chris-rock
Copy link
Contributor

Works perfectly with Windows 2012 R2 and Windows 2016
screen shot 2016-09-20 at 9 50 25 pm
screen shot 2016-09-20 at 9 53 09 pm

@chris-rock
Copy link
Contributor

we missed to update the functional test for appveyor. please update the test/windows/local and test/windows/winrm with the following sections:

  it 'verify os' do
    os = conn.os
    os[:name].must_equal 'Windows Server 2012 R2 Datacenter'
    os[:family].must_equal 'windows'
    os[:release].must_equal '6.3.9600'
    os[:arch].must_equal 'x86_64'
  end

See https://github.com/chef/train/blob/master/test/windows/local_test.rb#L22-L28 and https://github.com/chef/train/blob/master/test/windows/winrm_test.rb#L28-L34

@jerryaldrichiii
Copy link
Contributor Author

Yup! I missed that too!

Tests have been updated.

@chris-rock
Copy link
Contributor

fixes inspec/inspec#1100

This modifies the value of `@platform[:arch]` on Windows to resemble
what `uname` would return on Unix/Linux.
@chris-rock
Copy link
Contributor

Thanks @jerryaldrichiii the timeout error with docker is not related to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants