Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace some more FQCNs #72471

Merged
merged 1 commit into from
Nov 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/ansible/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ def __getitem__(self, y):
_ACTION_INCLUDE_VARS = add_internal_fqcns(('include_vars', ))
_ACTION_META = add_internal_fqcns(('meta', ))
_ACTION_SET_FACT = add_internal_fqcns(('set_fact', ))
_ACTION_SETUP = add_internal_fqcns(('setup', ))
_ACTION_HAS_CMD = add_internal_fqcns(('command', 'shell', 'script'))
_ACTION_ALLOWS_RAW_ARGS = _ACTION_HAS_CMD + add_internal_fqcns(('raw', ))
_ACTION_ALL_INCLUDES = _ACTION_INCLUDE + _ACTION_INCLUDE_TASKS + _ACTION_INCLUDE_ROLE
Expand All @@ -187,5 +188,5 @@ def __getitem__(self, y):
_ACTION_ALL_PROPER_INCLUDE_IMPORT_TASKS = _ACTION_INCLUDE_TASKS + _ACTION_IMPORT_TASKS
_ACTION_ALL_INCLUDE_ROLE_TASKS = _ACTION_INCLUDE_ROLE + _ACTION_INCLUDE_TASKS
_ACTION_ALL_INCLUDE_TASKS = _ACTION_INCLUDE + _ACTION_INCLUDE_TASKS
_ACTION_FACT_GATHERING = add_internal_fqcns(('setup', 'gather_facts'))
_ACTION_FACT_GATHERING = _ACTION_SETUP + add_internal_fqcns(('gather_facts', ))
_ACTION_WITH_CLEAN_FACTS = _ACTION_SET_FACT + _ACTION_INCLUDE_VARS
2 changes: 1 addition & 1 deletion lib/ansible/plugins/action/gather_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def _get_module_args(self, fact_module, task_vars):
mod_args = self._task.args.copy()

# deal with 'setup specific arguments'
if fact_module not in ['ansible.legacy.setup', 'ansible.builtin.setup', 'setup']:
if fact_module not in C._ACTION_SETUP:
# network facts modules must support gather_subset
if self._connection._load_name not in ('network_cli', 'httpapi', 'netconf'):
subset = mod_args.pop('gather_subset', None)
Expand Down
3 changes: 2 additions & 1 deletion lib/ansible/plugins/action/normal.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

from ansible import constants as C
from ansible.plugins.action import ActionBase
from ansible.utils.vars import merge_hash

Expand Down Expand Up @@ -48,7 +49,7 @@ def run(self, tmp=None, task_vars=None):
# hack to keep --verbose from showing all the setup module result
# moved from setup module as now we filter out all _ansible_ from result
# FIXME: is this still accurate with gather_facts etc, or does it need support for FQ and other names?
if self._task.action == 'setup':
if self._task.action in C._ACTION_SETUP:
result['_ansible_verbose_override'] = True

if not wrap_async:
Expand Down
3 changes: 2 additions & 1 deletion lib/ansible/plugins/callback/junit.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
import time
import re

from ansible import constants as C
from ansible.module_utils._text import to_bytes, to_text
from ansible.plugins.callback import CallbackBase

Expand Down Expand Up @@ -290,7 +291,7 @@ def _generate_report(self):
test_cases = []

for task_uuid, task_data in self._task_data.items():
if task_data.action == 'setup' and self._include_setup_tasks_in_report == 'false':
if task_data.action in C._ACTION_SETUP and self._include_setup_tasks_in_report == 'false':
continue

for host_uuid, host_data in task_data.host_data.items():
Expand Down
2 changes: 1 addition & 1 deletion lib/ansible/plugins/strategy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ def search_handler_blocks_by_name(handler_name, handler_blocks):

# If this is a role task, mark the parent role as being run (if
# the task was ok or failed, but not skipped or unreachable)
if original_task._role is not None and role_ran: # TODO: and original_task.action != 'include_role':?
if original_task._role is not None and role_ran: # TODO: and original_task.action not in C._ACTION_INCLUDE_ROLE:?
# lookup the role in the ROLE_CACHE to make sure we're dealing
# with the correct object and mark it as executed
for (entry, role_obj) in iteritems(iterator._play.ROLE_CACHE[original_task._role.get_name()]):
Expand Down