diff --git a/awx/main/models/inventory.py b/awx/main/models/inventory.py index 9b7cb546d0..175fa40236 100644 --- a/awx/main/models/inventory.py +++ b/awx/main/models/inventory.py @@ -9,7 +9,6 @@ import copy from urlparse import urljoin import os.path import six -from distutils.version import LooseVersion # Django from django.conf import settings @@ -42,7 +41,7 @@ from awx.main.models.notifications import ( NotificationTemplate, JobNotificationMixin, ) -from awx.main.utils import _inventory_updates, get_ansible_version, region_sorting +from awx.main.utils import _inventory_updates, region_sorting __all__ = ['Inventory', 'Host', 'Group', 'InventorySource', 'InventoryUpdate', @@ -1578,12 +1577,6 @@ class InventorySource(UnifiedJobTemplate, InventorySourceOptions, RelatedJobsMix "Instead, configure the corresponding source project to update on launch.")) return self.update_on_launch - def clean_overwrite_vars(self): # TODO: remove when Ansible 2.4 becomes unsupported, obviously - if self.source == 'scm' and not self.overwrite_vars: - if get_ansible_version() < LooseVersion('2.5'): - raise ValidationError(_("SCM type sources must set `overwrite_vars` to `true` until Ansible 2.5.")) - return self.overwrite_vars - def clean_source_path(self): if self.source != 'scm' and self.source_path: raise ValidationError(_("Cannot set source_path if not SCM type.")) diff --git a/awx/main/tests/functional/conftest.py b/awx/main/tests/functional/conftest.py index 30adb3cb66..a3e6199137 100644 --- a/awx/main/tests/functional/conftest.py +++ b/awx/main/tests/functional/conftest.py @@ -8,6 +8,7 @@ import tempfile import shutil from datetime import timedelta from six.moves import xrange +from mock import PropertyMock # Django from django.core.urlresolvers import resolve @@ -752,3 +753,8 @@ def sqlite_copy_expert(request): request.addfinalizer(lambda: delattr(SQLiteCursorWrapper, 'copy_expert')) return path + +@pytest.fixture +def disable_database_settings(mocker): + m = mocker.patch('awx.conf.settings.SettingsWrapper.all_supported_settings', new_callable=PropertyMock) + m.return_value = [] diff --git a/awx/main/tests/functional/test_dispatch.py b/awx/main/tests/functional/test_dispatch.py index 349d997e8f..b7dc158a9b 100644 --- a/awx/main/tests/functional/test_dispatch.py +++ b/awx/main/tests/functional/test_dispatch.py @@ -55,6 +55,7 @@ class SlowResultWriter(BaseWorker): super(SlowResultWriter, self).perform_work(body, result_queue) +@pytest.mark.usefixtures("disable_database_settings") class TestPoolWorker: def setup_method(self, test_method): @@ -247,6 +248,7 @@ class TestAutoScaling: assert len(self.pool) == 2 +@pytest.mark.usefixtures("disable_database_settings") class TestTaskDispatcher: @property diff --git a/awx/main/tests/unit/models/test_inventory.py b/awx/main/tests/unit/models/test_inventory.py index 7c58fa9972..04afa15894 100644 --- a/awx/main/tests/unit/models/test_inventory.py +++ b/awx/main/tests/unit/models/test_inventory.py @@ -73,17 +73,6 @@ def test_invalid_kind_clean_insights_credential(): class TestControlledBySCM(): - @pytest.mark.parametrize('source', [ - 'scm', - 'ec2', - 'manual', - ]) - def test_clean_overwrite_vars_valid(self, source): - inv_src = InventorySource(overwrite_vars=True, - source=source) - - inv_src.clean_overwrite_vars() - def test_clean_source_path_valid(self): inv_src = InventorySource(source_path='/not_real/', source='scm') diff --git a/tools/docker-compose/start_development.sh b/tools/docker-compose/start_development.sh index 5ea5041ec4..36c5628b60 100755 --- a/tools/docker-compose/start_development.sh +++ b/tools/docker-compose/start_development.sh @@ -2,7 +2,7 @@ set +x if [ `id -u` -ge 500 ]; then - echo "awx:x:`id -u`:`id -g`:,,,:/var/lib/awx:/bin/bash" >> /tmp/passwd + echo "awx:x:`id -u`:`id -g`:,,,:/tmp:/bin/bash" >> /tmp/passwd cat /tmp/passwd > /etc/passwd rm /tmp/passwd fi diff --git a/tools/docker-compose/start_tests.sh b/tools/docker-compose/start_tests.sh index 7db222ed32..4ca74743fb 100755 --- a/tools/docker-compose/start_tests.sh +++ b/tools/docker-compose/start_tests.sh @@ -2,7 +2,7 @@ set +x if [ `id -u` -ge 500 ]; then - echo "awx:x:`id -u`:`id -g`:,,,:/var/lib/awx:/bin/bash" >> /tmp/passwd + echo "awx:x:`id -u`:`id -g`:,,,:/tmp:/bin/bash" >> /tmp/passwd cat /tmp/passwd > /etc/passwd rm /tmp/passwd fi