Revert "Merge pull request #1534 from chrismeyersfsu/fix-config_performance"

This reverts commit 7cc144fa59f157a5e1789a913e0d9a31720141ec, reversing
changes made to 86af9950e754b06f40cb293a36ab365f589273db.
This commit is contained in:
Matthew Jones 2016-04-14 11:40:07 -04:00
parent ae1e6943f4
commit 6f79ec8830
4 changed files with 0 additions and 31 deletions

View File

@ -1,5 +0,0 @@
def test_ANSIBLE_VERSION(mocker):
from django.conf import settings
assert hasattr(settings, 'ANSIBLE_VERSION')

View File

@ -1,19 +0,0 @@
import subprocess
from awx.main.utils import get_ansible_version
def test_dev(mocker, settings):
settings.ANSIBLE_VERSION = mocker.Mock()
res = get_ansible_version()
assert res == settings.ANSIBLE_VERSION
def test_production(mocker, settings):
mock_Popen = mocker.MagicMock()
mocker.patch.object(subprocess, 'Popen', mock_Popen)
del settings.ANSIBLE_VERSION
get_ansible_version()
mock_Popen.assert_called_with(['ansible', '--version'], stdout=subprocess.PIPE)

View File

@ -97,9 +97,6 @@ def get_ansible_version():
'''
Return Ansible version installed.
'''
from django.conf import settings
if hasattr(settings, 'ANSIBLE_VERSION'):
return settings.ANSIBLE_VERSION
try:
proc = subprocess.Popen(['ansible', '--version'],
stdout=subprocess.PIPE)

View File

@ -10,8 +10,6 @@ import traceback
# Django Split Settings
from split_settings.tools import optional, include
from awx.main.utils import get_ansible_version
# Load default settings.
from defaults import * # NOQA
@ -35,8 +33,6 @@ AWX_PROOT_ENABLED = True
PENDO_TRACKING_STATE = "off"
ANSIBLE_VERSION = get_ansible_version()
# Use Django-Jenkins if installed. Only run tests for awx.main app.
try:
import django_jenkins