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

(FACT-2728) Added hypervisors fact for Solaris #2045

Merged
merged 1 commit into from
Aug 31, 2020

Conversation

sebastian-miclea
Copy link
Contributor

No description provided.

@sebastian-miclea sebastian-miclea added the enhancement New feature or enhancement label Aug 25, 2020
@sebastian-miclea sebastian-miclea requested review from a team August 25, 2020 13:43
@sebastian-miclea sebastian-miclea changed the title (FACT_2728) Added hypervisors fact for Solaris (FACT-2728) Added hypervisors fact for Solaris Aug 25, 2020
end

def resolve(key)
Facter::Resolvers::Solaris::Ldom.resolve(key)
Copy link
Contributor

Choose a reason for hiding this comment

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

i think you can replace this with something like:

%i[
  chassis_serial control_domain domain_name
  domain_uuid role_control role_io role_root role_service
].map! { |key| [key, Facter::Resolvers::Solaris::Ldom.resolve(key)] }.to_h

Comment on lines +28 to +34
{
brand: current_zone[:brand],
id: current_zone[:id],
ip_type: current_zone[:iptype],
name: current_zone[:name],
uuid: current_zone[:uuid]
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively yo this you could also use Hash#select or something similar to keep only the needed keys.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem here is that one key (ip_type) needs to be changed, so no general rule to map keys would work.

@puppetcla
Copy link

CLA signed by all contributors.

@oanatmaria oanatmaria merged commit 34cc10a into puppetlabs:4.x Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants