mirror of
https://github.com/ansible/awx.git
synced 2026-02-18 11:40:05 -03:30
allow user provided fact scan modules
This commit is contained in:
@@ -9,17 +9,15 @@ from django.core.management.base import NoArgsCommand
|
|||||||
from awx.fact.models.fact import * # noqa
|
from awx.fact.models.fact import * # noqa
|
||||||
from awx.main.socket import Socket
|
from awx.main.socket import Socket
|
||||||
|
|
||||||
_MODULES = ['packages', 'services', 'files']
|
|
||||||
|
|
||||||
logger = logging.getLogger('awx.main.commands.run_fact_cache_receiver')
|
logger = logging.getLogger('awx.main.commands.run_fact_cache_receiver')
|
||||||
class FactCacheReceiver(object):
|
class FactCacheReceiver(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.timestamp = None
|
self.timestamp = None
|
||||||
|
|
||||||
def _determine_module(self, facts):
|
def _determine_module(self, facts):
|
||||||
for x in _MODULES:
|
# Symantically determine the module type
|
||||||
if x in facts:
|
if len(facts) == 1:
|
||||||
return x
|
return facts.iterkeys().next()
|
||||||
return 'ansible'
|
return 'ansible'
|
||||||
|
|
||||||
def _extract_module_facts(self, module, facts):
|
def _extract_module_facts(self, module, facts):
|
||||||
|
|||||||
Reference in New Issue
Block a user