- 
                Notifications
    
You must be signed in to change notification settings  - Fork 6
 
          Fix resolution of the virtual fact on FreeBSD
          #16
        
          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
Conversation
24d6341    to
    2214d22      
    Compare
  
    | 
           I fixed the mistakes that caused the jRuby failures. Interesting it did not failed with other implementations of Ruby 🤷  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this mechanism to detect if an implementation for the given os type exists.
The merge-base changed after approval.
The merge-base changed after approval.
The merge-base changed after approval.
The merge-base changed after approval.
The merge-base changed after approval.
2214d22    to
    8b39081      
    Compare
  
    We should not call Linux-specific code from a non-Linux system. This cross-platform utility class needs to skip Linux code when running on a non-linux platform.
8b39081    to
    80b3fef      
    Compare
  
    
We should not call Linux-specific code from a non-Linux system. Before #15, the Linux-specific code was unexpectedly loaded, and the Linux resolver was non-functional on FreeBSD, causing a warning to be output. With #15, the Linux specific code is not loaded anymore, breaking further the fact resolution.
In order to fix this, the virtual_detector code needs to either be split into platform-specific pieces, or take care to only call platform-specific code on these platforms. Given this is a utility class, I chose the second route, and since the Linux-specific code is now only loaded on Linux, rely on the namespace existing or not to determine if we should run that code.
Originally submitted as:
puppetlabs/facter#2744