mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
Merge pull request #3694 from ryanpetrello/gbye-callback-plugins
remove the old callback plugin import paths Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
10
Makefile
10
Makefile
@@ -60,7 +60,7 @@ I18N_FLAG_FILE = .i18n_built
|
|||||||
|
|
||||||
.PHONY: awx-link clean clean-tmp clean-venv requirements requirements_dev \
|
.PHONY: awx-link clean clean-tmp clean-venv requirements requirements_dev \
|
||||||
develop refresh adduser migrate dbchange dbshell runserver \
|
develop refresh adduser migrate dbchange dbshell runserver \
|
||||||
receiver test test_unit test_ansible test_coverage coverage_html \
|
receiver test test_unit test_coverage coverage_html \
|
||||||
dev_build release_build release_clean sdist \
|
dev_build release_build release_clean sdist \
|
||||||
ui-docker-machine ui-docker ui-release ui-devel \
|
ui-docker-machine ui-docker ui-release ui-devel \
|
||||||
ui-test ui-deps ui-test-ci VERSION
|
ui-test ui-deps ui-test-ci VERSION
|
||||||
@@ -378,20 +378,12 @@ test:
|
|||||||
PYTHONDONTWRITEBYTECODE=1 py.test -p no:cacheprovider -n auto $(TEST_DIRS)
|
PYTHONDONTWRITEBYTECODE=1 py.test -p no:cacheprovider -n auto $(TEST_DIRS)
|
||||||
awx-manage check_migrations --dry-run --check -n 'vNNN_missing_migration_file'
|
awx-manage check_migrations --dry-run --check -n 'vNNN_missing_migration_file'
|
||||||
|
|
||||||
test_combined: test_ansible test
|
|
||||||
|
|
||||||
test_unit:
|
test_unit:
|
||||||
@if [ "$(VENV_BASE)" ]; then \
|
@if [ "$(VENV_BASE)" ]; then \
|
||||||
. $(VENV_BASE)/awx/bin/activate; \
|
. $(VENV_BASE)/awx/bin/activate; \
|
||||||
fi; \
|
fi; \
|
||||||
py.test awx/main/tests/unit awx/conf/tests/unit awx/sso/tests/unit
|
py.test awx/main/tests/unit awx/conf/tests/unit awx/sso/tests/unit
|
||||||
|
|
||||||
test_ansible:
|
|
||||||
@if [ "$(VENV_BASE)" ]; then \
|
|
||||||
. $(VENV_BASE)/ansible/bin/activate; \
|
|
||||||
fi; \
|
|
||||||
py.test awx/lib/tests -c awx/lib/tests/pytest.ini
|
|
||||||
|
|
||||||
# Run all API unit tests with coverage enabled.
|
# Run all API unit tests with coverage enabled.
|
||||||
test_coverage:
|
test_coverage:
|
||||||
@if [ "$(VENV_BASE)" ]; then \
|
@if [ "$(VENV_BASE)" ]; then \
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
# Copyright (c) 2017 Ansible by Red Hat
|
|
||||||
#
|
|
||||||
# This file is part of Ansible Tower, but depends on code imported from Ansible.
|
|
||||||
#
|
|
||||||
# Ansible is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# Ansible is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
|
||||||
|
|
||||||
# Python
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
# Add awx/lib to sys.path.
|
|
||||||
awx_lib_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
|
|
||||||
if awx_lib_path not in sys.path:
|
|
||||||
sys.path.insert(0, awx_lib_path)
|
|
||||||
|
|
||||||
# Tower Display Callback
|
|
||||||
from awx_display_callback import AWXDefaultCallbackModule as CallbackModule # noqa
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
# Copyright (c) 2017 Ansible by Red Hat
|
|
||||||
#
|
|
||||||
# This file is part of Ansible Tower, but depends on code imported from Ansible.
|
|
||||||
#
|
|
||||||
# Ansible is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# Ansible is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
|
||||||
|
|
||||||
# Python
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
# Add awx/lib to sys.path.
|
|
||||||
awx_lib_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
|
|
||||||
if awx_lib_path not in sys.path:
|
|
||||||
sys.path.insert(0, awx_lib_path)
|
|
||||||
|
|
||||||
# Tower Display Callback
|
|
||||||
from awx_display_callback import AWXMinimalCallbackModule as CallbackModule # noqa
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
# Python
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
# Based on http://stackoverflow.com/a/6879344/131141 -- Initialize awx display
|
|
||||||
# callback as early as possible to wrap ansible.display.Display methods.
|
|
||||||
|
|
||||||
|
|
||||||
def argv_ready(argv):
|
|
||||||
if argv and os.path.basename(argv[0]) in {'ansible', 'ansible-playbook'}:
|
|
||||||
import awx_display_callback # noqa
|
|
||||||
|
|
||||||
|
|
||||||
class argv_placeholder(object):
|
|
||||||
|
|
||||||
def __del__(self):
|
|
||||||
try:
|
|
||||||
argv_ready(sys.argv)
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
if hasattr(sys, 'argv'):
|
|
||||||
argv_ready(sys.argv)
|
|
||||||
else:
|
|
||||||
sys.argv = argv_placeholder()
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
[pytest]
|
|
||||||
addopts = -v
|
|
||||||
@@ -20,8 +20,8 @@ class CallbackBrokerWorker(BaseWorker):
|
|||||||
A worker implementation that deserializes callback event data and persists
|
A worker implementation that deserializes callback event data and persists
|
||||||
it into the database.
|
it into the database.
|
||||||
|
|
||||||
The code that *builds* these types of messages is found in the AWX display
|
The code that *generates* these types of messages is found in the
|
||||||
callback (`awx.lib.awx_display_callback`).
|
ansible-runner display callback plugin.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
MAX_RETRIES = 2
|
MAX_RETRIES = 2
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ from awx.main.dispatch.worker import AWXConsumer, CallbackBrokerWorker
|
|||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
'''
|
'''
|
||||||
Save Job Callback receiver (see awx.plugins.callbacks.job_event_callback)
|
Save Job Callback receiver
|
||||||
Runs as a management command and receives job save events. It then hands
|
Runs as a management command and receives job save events. It then hands
|
||||||
them off to worker processors (see Worker) which writes them to the database
|
them off to worker processors (see Worker) which writes them to the database
|
||||||
'''
|
'''
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
# Copyright (c) 2016 Ansible by Red Hat, Inc.
|
|
||||||
#
|
|
||||||
# This file is part of Ansible Tower, but depends on code imported from Ansible.
|
|
||||||
#
|
|
||||||
# Ansible is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# Ansible is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
|
||||||
|
|
||||||
# Python
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
# Add awx/lib to sys.path.
|
|
||||||
awx_lib_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'lib'))
|
|
||||||
if awx_lib_path not in sys.path:
|
|
||||||
sys.path.insert(0, awx_lib_path)
|
|
||||||
|
|
||||||
# Tower Display Callback
|
|
||||||
from awx_display_callback import AWXDefaultCallbackModule as CallbackModule # noqa
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
# Copyright (c) 2016 Ansible by Red Hat, Inc.
|
|
||||||
#
|
|
||||||
# This file is part of Ansible Tower, but depends on code imported from Ansible.
|
|
||||||
#
|
|
||||||
# Ansible is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# Ansible is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
|
||||||
|
|
||||||
# Python
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
# Add awx/lib to sys.path.
|
|
||||||
awx_lib_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'lib'))
|
|
||||||
if awx_lib_path not in sys.path:
|
|
||||||
sys.path.insert(0, awx_lib_path)
|
|
||||||
|
|
||||||
# Tower Display Callback
|
|
||||||
from awx_display_callback import AWXMinimalCallbackModule as CallbackModule # noqa
|
|
||||||
@@ -13,6 +13,6 @@ services:
|
|||||||
RABBITMQ_USER: guest
|
RABBITMQ_USER: guest
|
||||||
RABBITMQ_PASS: guest
|
RABBITMQ_PASS: guest
|
||||||
RABBITMQ_VHOST: /
|
RABBITMQ_VHOST: /
|
||||||
command: ["make test_combined"]
|
command: ["make test"]
|
||||||
volumes:
|
volumes:
|
||||||
- ../../../:/awx_devel
|
- ../../../:/awx_devel
|
||||||
|
|||||||
Reference in New Issue
Block a user