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

add sys_info resource to get information about the hostname #1035

Merged
merged 2 commits into from
Sep 9, 2016

Conversation

chris-rock
Copy link
Contributor

@chris-rock chris-rock commented Sep 8, 2016

Adds the ability to requests the hostname of the current system:

describe sys_info do
  its('hostname') { should eq 'example.com' }
end

@chris-rock
Copy link
Contributor Author

This is required for some Windows improvements for #990. We could also argue, this belongs into train

@chris-rock
Copy link
Contributor Author

quickly discussed with @arlimus that this does not belong into train

# windows hostname
inspec.powershell('$env:computername').stdout.chomp
else
return skip_resource 'The `system` resource is not supported on your OS yet.'
Copy link
Contributor

Choose a reason for hiding this comment

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

You can elide the explicit return here if you want

@stevendanna
Copy link
Contributor

👍 Left some minor, non-critical comments. It might be worth thinking about whether we want the same hostname, fqdn, and machinename split that ohai has. The pro of the split is that it makes the semantics of what gets returned a bit more consistent even when run on differently configured systems. The downside of the ohai method is that you need to understand the difference between those vaguely defined concepts since it doesn't map 1-to-1 with the command output.

Just food for thought.

@chris-rock
Copy link
Contributor Author

@stevendanna lets add those features in another iteration. For now it simply returns what the system is telling us :-)

@chris-rock chris-rock merged commit e44a380 into master Sep 9, 2016
@chris-rock chris-rock deleted the chris-rock/sys_info branch September 9, 2016 10:50
@chris-rock chris-rock modified the milestone: 0.34.0 Sep 9, 2016
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.

None yet

3 participants