Skip to content

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

Merged
oanatmaria merged 1 commit intopuppetlabs:4.xfrom
sebastian-miclea:FACT-2728
Aug 31, 2020
Merged

(FACT-2728) Added hypervisors fact for Solaris#2045
oanatmaria merged 1 commit intopuppetlabs:4.xfrom
sebastian-miclea:FACT-2728

Conversation

@sebastian-miclea
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown

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
Copy Markdown
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
Copy Markdown

CLA signed by all contributors.

Comment thread lib/facter/facts/solaris/hypervisors/zone.rb Outdated
Comment thread spec/facter/facts/solaris/hypervisors/zone_spec.rb
@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