Skip to content

Commit

Permalink
Update canonical_facts to load needed components (#3444)
Browse files Browse the repository at this point in the history
* For client apps that don't use insights components, this will
  allow them to still use get_canonical_facts for uploads

Signed-off-by: Bob Fahr <[email protected]>

Co-authored-by: Link Dupont <[email protected]>
  • Loading branch information
bfahr and subpop committed Jun 17, 2022
1 parent 514b99e commit 11089d4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions insights/util/canonical_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from insights.specs import Specs
from insights.core import Parser
from insights.core.plugins import parser
from insights.core.dr import set_enabled
from insights.core.dr import set_enabled, load_components
import uuid


Expand Down Expand Up @@ -135,6 +135,8 @@ def canonical_facts(


def get_canonical_facts(path=None):
load_components("insights.specs.default")

set_enabled(canonical_facts, True)
set_enabled(SubscriptionManagerID, True)
set_enabled(IPs, True)
Expand All @@ -146,7 +148,8 @@ def get_canonical_facts(path=None):

if __name__ == "__main__":
import json
from insights import dr
dr.load_components("insights.specs.default", "insights.specs.insights_archive")

# Load both default and archive to support host and archive collection
load_components("insights.specs.default", "insights.specs.insights_archive")

print(json.dumps(get_canonical_facts()))

0 comments on commit 11089d4

Please sign in to comment.