Jira (FACT-3008) Make VirtualDetector static

14 views
Skip to first unread message

Gabriel Nagy (Jira)

unread,
Apr 13, 2021, 6:20:01 AM4/13/21
to puppe...@googlegroups.com
Gabriel Nagy created an issue
 
Facter / Improvement FACT-3008
Make VirtualDetector static
Issue Type: Improvement Improvement
Assignee: Unassigned
Created: 2021/04/13 3:19 AM
Labels: tech-debt
Priority: Normal Normal
Reporter: Gabriel Nagy

The VirtualDetector class provides information that is unchanged during Facter execution. To access information from it, the developer has to create an instance of the class, which doesn't make much sense.

We should make all the methods static and memoize the value returned by .platform.
There are about 7 places where this class is instantiated in Facter, those also have to be updated.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Mihai Buzgau (Jira)

unread,
Apr 13, 2021, 9:37:02 AM4/13/21
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: ready for triage NW-2021-04-28

Ciprian Badescu (Jira)

unread,
Apr 14, 2021, 5:46:04 AM4/14/21
to puppe...@googlegroups.com
Ciprian Badescu updated an issue
Change By: Ciprian Badescu
Convert [VirtualDetector|https://github.com/puppetlabs/facter/blob/4571ea0c29d5ca1965c88d093b5ec58ca7f40fdd/lib/facter/util/facts/virtual_detector.rb] class to module and remove debug logs.

 

The [VirtualDetector|https://github.com/puppetlabs/facter/blob/4571ea0c29d5ca1965c88d093b5ec58ca7f40fdd/lib/facter/util/facts/virtual_detector.rb] class provides information that is unchanged during Facter execution. To access information from it, the developer has to create an instance of the class, which doesn't make much sense.

We should make all the methods static and memoize the value returned by {{.platform}}.

There are about 7 places where this class is instantiated in Facter, those also have to be updated.

Ciprian Badescu (Jira)

unread,
Apr 14, 2021, 5:48:04 AM4/14/21
to puppe...@googlegroups.com
Ciprian Badescu updated an issue
Change By: Ciprian Badescu
Story Points: 2

Luchian Nemes (Jira)

unread,
Apr 19, 2021, 12:55:03 PM4/19/21
to puppe...@googlegroups.com
Luchian Nemes assigned an issue to Luchian Nemes
Change By: Luchian Nemes
Assignee: Luchian Nemes

Luchian Nemes (Jira)

unread,
Apr 20, 2021, 3:17:04 AM4/20/21
to puppe...@googlegroups.com
Luchian Nemes assigned an issue to Victor Bobosila
Change By: Luchian Nemes
Assignee: Luchian Nemes Victor Bobosila

Gabriel Nagy (Jira)

unread,
May 19, 2021, 8:04:01 AM5/19/21
to puppe...@googlegroups.com
Gabriel Nagy updated an issue
Change By: Gabriel Nagy
Fix Version/s: FACT 4.2.0
Reply all
Reply to author
Forward
0 new messages