Skip to content

(FACT-2218) virtual fact for OSX#1945

Merged
oanatmaria merged 9 commits into4.xfrom
FACT-2218
Jun 30, 2020
Merged

(FACT-2218) virtual fact for OSX#1945
oanatmaria merged 9 commits into4.xfrom
FACT-2218

Conversation

@BogdanIrimie
Copy link
Copy Markdown
Contributor

@BogdanIrimie BogdanIrimie commented Jun 29, 2020

Added virtual fact. Refactored system_profiler resolver so it only reads partial data.

@BogdanIrimie BogdanIrimie added the enhancement New feature or enhancement label Jun 29, 2020
@BogdanIrimie BogdanIrimie marked this pull request as ready for review June 29, 2020 15:09
@BogdanIrimie BogdanIrimie requested review from a team June 29, 2020 15:09
@puppetcla
Copy link
Copy Markdown

CLA signed by all contributors.


def check_parallels
subsystem_vendor_id = Facter::Resolvers::Macosx::SystemProfiler.resolve(:subsystem_vendor_id)
return 'parallels' if subsystem_vendor_id&.start_with?('0x1ab8')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is 0x1ab8 constant? Won't it change on other versions?

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.

This is a constant used since Facter 2.x

result = "parallels" if output["spethernet_subsystem-vendor-id"] =~ /0x1ab8/

It is the same for Facter 3.x

if (line == "Subsystem Vendor ID: 0x1ab8") {

@oanatmaria oanatmaria merged commit 8a3accd into 4.x Jun 30, 2020
@BogdanIrimie BogdanIrimie deleted the FACT-2218 branch July 9, 2020 08:22
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