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

Inspec Detect Issues #772

Closed
fcaviggia opened this issue May 27, 2016 · 3 comments
Closed

Inspec Detect Issues #772

fcaviggia opened this issue May 27, 2016 · 3 comments
Labels
Type: Bug Feature not working as expected
Milestone

Comments

@fcaviggia
Copy link

Description

Inspec is not properly pulling the architecture information from the host.

[root@rhel7 ~]# /usr/local/bin/inspec detect
{"name":null,"family":"redhat","release":"7.2","arch":null}

[fcaviggia@rhel7 ~]$ inspec detect
Operating System Details
------------------------
Name:
Family: redhat
Release: 7.2
Arch:

[fcaviggia@rhel7 ~]$ inspec shell
inspec> describe os.params.arch
NoMethodError: undefined method `params' for Operating System Detection:Inspec::Resource::Registry::Os
from (pry):5:in `load'

[fcaviggia@rhel7 ~]$ cat test-issue.rb
describe os.params.arch
[fcaviggia@rhel7 ~]$ inspec exec test-issue.rb
test-issue.rb:1:in `load': undefined method `arch' for {:name=>nil, :family=>"redhat", :release=>"7.2", :arch=>nil}:Hash (NoMethodError)
        from /home/fcaviggia/.gem/ruby/gems/inspec-0.22.1/lib/inspec/profile_context.rb:39:in `instance_eval'
        from /home/fcaviggia/.gem/ruby/gems/inspec-0.22.1/lib/inspec/profile_context.rb:39:in `load'
        from /home/fcaviggia/.gem/ruby/gems/inspec-0.22.1/lib/inspec/runner.rb:130:in `add_test_to_context'
        from /home/fcaviggia/.gem/ruby/gems/inspec-0.22.1/lib/inspec/runner.rb:114:in `block in add_content'
        from /home/fcaviggia/.gem/ruby/gems/inspec-0.22.1/lib/inspec/runner.rb:114:in `each'
        from /home/fcaviggia/.gem/ruby/gems/inspec-0.22.1/lib/inspec/runner.rb:114:in `add_content'
        from /home/fcaviggia/.gem/ruby/gems/inspec-0.22.1/lib/inspec/runner.rb:87:in `add_profile'
        from /home/fcaviggia/.gem/ruby/gems/inspec-0.22.1/lib/inspec/runner.rb:51:in `add_target'
        from /home/fcaviggia/.gem/ruby/gems/inspec-0.22.1/lib/utils/base_cli.rb:69:in `block in run_tests'
        from /home/fcaviggia/.gem/ruby/gems/inspec-0.22.1/lib/utils/base_cli.rb:69:in `each'
        from /home/fcaviggia/.gem/ruby/gems/inspec-0.22.1/lib/utils/base_cli.rb:69:in `run_tests'
        from /home/fcaviggia/.gem/ruby/gems/inspec-0.22.1/lib/inspec/cli.rb:111:in `exec'
        from /usr/local/share/gems/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /usr/local/share/gems/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /usr/local/share/gems/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from /usr/local/share/gems/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from /home/fcaviggia/.gem/ruby/gems/inspec-0.22.1/bin/inspec:9:in `<top (required)>'
        from /usr/local/bin/inspec:23:in `load'
        from /usr/local/bin/inspec:23:in `<main>'

Similar issues reported on Mac:

Aarons-MacBook-Air:~ aaronl$ inspec detect
Operating System Details
------------------------
Name: mac_os_x
Family: darwin
Release: 10.11.6
Arch:

InSpec and Platform Version

$ inspec version
0.22.1

RHEL 7.2, Mac OS 10.11.6

Replication Case

Seems reproducible on several platforms.

@chris-rock
Copy link
Contributor

chris-rock commented May 30, 2016

inspec shell
Welcome to the interactive InSpec Shell
To find out how to use it, type: help

inspec> os.params
=> {:name=>"mac_os_x", :family=>"darwin", :release=>"10.10.5", :arch=>nil}
inspec> os.params[:arch]
=> nil
inspec> os.params[:release]
=> "10.10.5"
inspec> exit

Okay, we have two issues here:

@chris-rock
Copy link
Contributor

This is already available out of the box

inspec> os[:arch]
=> nil
inspec> os[:family]
=> "darwin"

@chris-rock
Copy link
Contributor

this will be solved with release 0.29.0 that will depend on train 0.16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Feature not working as expected
Projects
None yet
Development

No branches or pull requests

3 participants