From c2a87bbb53a5a9cd7489c3e83acaa84c8b786a1c Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Tue, 12 May 2015 09:39:37 -0400 Subject: [PATCH] allow user provided fact scan modules --- awx/main/management/commands/run_fact_cache_receiver.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/awx/main/management/commands/run_fact_cache_receiver.py b/awx/main/management/commands/run_fact_cache_receiver.py index 2330a449e8..5498b2c577 100644 --- a/awx/main/management/commands/run_fact_cache_receiver.py +++ b/awx/main/management/commands/run_fact_cache_receiver.py @@ -9,17 +9,15 @@ from django.core.management.base import NoArgsCommand from awx.fact.models.fact import * # noqa from awx.main.socket import Socket -_MODULES = ['packages', 'services', 'files'] - logger = logging.getLogger('awx.main.commands.run_fact_cache_receiver') class FactCacheReceiver(object): def __init__(self): self.timestamp = None def _determine_module(self, facts): - for x in _MODULES: - if x in facts: - return x + # Symantically determine the module type + if len(facts) == 1: + return facts.iterkeys().next() return 'ansible' def _extract_module_facts(self, module, facts):