mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
moved new fact implementation to fact app
This commit is contained in:
parent
85c753afea
commit
2a039bb31f
20
awx/fact/__init__.py
Normal file
20
awx/fact/__init__.py
Normal file
@ -0,0 +1,20 @@
|
||||
# Copyright (c) 2014 AnsibleWorks, Inc.
|
||||
# All Rights Reserved.
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import logging
|
||||
from django.conf import settings
|
||||
|
||||
from mongoengine import connect
|
||||
from mongoengine.connection import get_db, ConnectionError
|
||||
from .utils.dbtransform import register_key_transform
|
||||
|
||||
logger = logging.getLogger('fact.__init__')
|
||||
|
||||
# Connect to Mongo
|
||||
try:
|
||||
connect(settings.MONGO_DB)
|
||||
register_key_transform(get_db())
|
||||
except ConnectionError:
|
||||
logger.warn('Failed to establish connect to MongDB "%s"' % (settings.MONGO_DB))
|
||||
6
awx/fact/models/__init__.py
Normal file
6
awx/fact/models/__init__.py
Normal file
@ -0,0 +1,6 @@
|
||||
# Copyright (c) 2015 Ansible, Inc.
|
||||
# All Rights Reserved
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
from .fact import * # noqa
|
||||
7
awx/fact/tests/__init__.py
Normal file
7
awx/fact/tests/__init__.py
Normal file
@ -0,0 +1,7 @@
|
||||
# Copyright (c) 2015 Ansible, Inc.
|
||||
# All Rights Reserved
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
from .models import * # noqa
|
||||
from .utils import * # noqa
|
||||
6
awx/fact/tests/models/__init__.py
Normal file
6
awx/fact/tests/models/__init__.py
Normal file
@ -0,0 +1,6 @@
|
||||
# Copyright (c) 2015 Ansible, Inc.
|
||||
# All Rights Reserved
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
from .fact import * # noqa
|
||||
@ -8,7 +8,7 @@ from copy import deepcopy
|
||||
# Django
|
||||
|
||||
# AWX
|
||||
from awx.main.models.fact import * # noqa
|
||||
from awx.fact.models.fact import * # noqa
|
||||
from awx.main.tests.base import BaseTest, MongoDBRequired
|
||||
|
||||
__all__ = ['FactHostTest', 'FactTest', 'FactGetHostVersionTest', 'FactGetHostTimeline']
|
||||
6
awx/fact/tests/utils/__init__.py
Normal file
6
awx/fact/tests/utils/__init__.py
Normal file
@ -0,0 +1,6 @@
|
||||
# Copyright (c) 2015 Ansible, Inc.
|
||||
# All Rights Reserved
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
from .dbtransform import * # noqa
|
||||
@ -10,7 +10,7 @@ from django.conf import settings
|
||||
|
||||
# AWX
|
||||
from awx.main.tests.base import BaseTest, MongoDBRequired
|
||||
from awx.main.models.fact import * # noqa
|
||||
from awx.fact.models.fact import * # noqa
|
||||
|
||||
__all__ = ['DBTransformTest']
|
||||
|
||||
@ -1,4 +1,2 @@
|
||||
# Copyright (c) 2015 Ansible, Inc.
|
||||
# All Rights Reserved
|
||||
|
||||
from awx.main.tests.models.fact import * # noqa
|
||||
@ -6,7 +6,7 @@ from datetime import datetime
|
||||
|
||||
from django.core.management.base import NoArgsCommand
|
||||
|
||||
from awx.main.models import * # noqa
|
||||
from awx.fact.models.fact import * # noqa
|
||||
from awx.main.socket import Socket
|
||||
|
||||
_MODULES = ['packages', 'services', 'files']
|
||||
|
||||
@ -16,7 +16,6 @@ from awx.main.models.ad_hoc_commands import * # noqa
|
||||
from awx.main.models.schedules import * # noqa
|
||||
from awx.main.models.activity_stream import * # noqa
|
||||
from awx.main.models.ha import * # noqa
|
||||
from awx.main.models.fact import * # noqa
|
||||
|
||||
# Monkeypatch Django serializer to ignore django-taggit fields (which break
|
||||
# the dumpdata command; see https://github.com/alex/django-taggit/issues/155).
|
||||
|
||||
@ -15,6 +15,4 @@ from awx.main.tests.activity_stream import * # noqa
|
||||
from awx.main.tests.schedules import * # noqa
|
||||
from awx.main.tests.redact import * # noqa
|
||||
from awx.main.tests.views import * # noqa
|
||||
from awx.main.tests.models import * # noqa
|
||||
from awx.main.tests.commands import * # noqa
|
||||
from awx.main.tests.dbtransform import * # noqa
|
||||
|
||||
@ -13,7 +13,7 @@ from mock import MagicMock
|
||||
from awx.main.tests.base import BaseTest, MongoDBRequired
|
||||
from awx.main.tests.commands.base import BaseCommandMixin
|
||||
from awx.main.management.commands.run_fact_cache_receiver import FactCacheReceiver
|
||||
from awx.main.models.fact import * # noqa
|
||||
from awx.fact.models.fact import * # noqa
|
||||
|
||||
__all__ = ['RunFactCacheReceiverUnitTest', 'RunFactCacheReceiverFunctionalTest']
|
||||
|
||||
|
||||
@ -1,16 +1,2 @@
|
||||
# Copyright (c) 2014 AnsibleWorks, Inc.
|
||||
# All Rights Reserved.
|
||||
|
||||
from django.conf import settings
|
||||
from mongoengine import connect
|
||||
from mongoengine.connection import get_db, ConnectionError
|
||||
from awx.main.dbtransform import register_key_transform
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger('awx.settings.__init__')
|
||||
|
||||
try:
|
||||
connect(settings.MONGO_DB)
|
||||
register_key_transform(get_db())
|
||||
except ConnectionError:
|
||||
logger.warn('Failed to establish connect to MongDB "%s"' % (settings.MONGO_DB))
|
||||
|
||||
@ -155,6 +155,7 @@ INSTALLED_APPS = (
|
||||
'awx.main',
|
||||
'awx.api',
|
||||
'awx.ui',
|
||||
'awx.fact',
|
||||
)
|
||||
|
||||
INTERNAL_IPS = ('127.0.0.1',)
|
||||
|
||||
@ -32,7 +32,7 @@ AWX_PROOT_ENABLED = True
|
||||
try:
|
||||
import django_jenkins
|
||||
INSTALLED_APPS += ('django_jenkins',)
|
||||
PROJECT_APPS = ('awx.main.tests', 'awx.api.tests',)
|
||||
PROJECT_APPS = ('awx.main.tests', 'awx.api.tests', 'awx.fact.tests',)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user