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

[2.16] Fix TE traceback from NetworkConnectionBase default attributes #82956

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

s-hertel
Copy link
Contributor

@s-hertel s-hertel commented Apr 2, 2024

SUMMARY

Backport for #82954.

The traceback this fixes:

The full traceback is:
Traceback (most recent call last):
  File "/home/shertel/ansible/lib/ansible/plugins/connection/__init__.py", line 324, in __getattr__
    return self.__dict__[name]
           ~~~~~~~~~~~~~^^^^^^
KeyError: '_nonetype'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/shertel/ansible/lib/ansible/executor/task_executor.py", line 1009, in _set_plugin_options
    plugin = getattr(self._connection, '_%s' % plugin_type)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shertel/ansible/lib/ansible/plugins/connection/__init__.py", line 332, in __getattr__
    raise AttributeError("'%s' object has no attribute '%s'" % (self.__class__.__name__, name))
AttributeError: 'Connection' object has no attribute '_nonetype'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/shertel/ansible/lib/ansible/plugins/connection/__init__.py", line 324, in __getattr__
    return self.__dict__[name]
           ~~~~~~~~~~~~~^^^^^^
KeyError: 'nonetype'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/shertel/ansible/lib/ansible/executor/task_executor.py", line 165, in run
    res = self._execute()
          ^^^^^^^^^^^^^^^
  File "/home/shertel/ansible/lib/ansible/executor/task_executor.py", line 581, in _execute
    plugin_vars = self._set_connection_options(cvars, templar)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shertel/ansible/lib/ansible/executor/task_executor.py", line 1091, in _set_connection_options
    varnames.extend(self._set_plugin_options(plugin_type, variables, templar, task_keys))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shertel/ansible/lib/ansible/executor/task_executor.py", line 1012, in _set_plugin_options
    plugin = getattr(self._connection, plugin_type)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shertel/ansible/lib/ansible/plugins/connection/__init__.py", line 332, in __getattr__
    raise AttributeError("'%s' object has no attribute '%s'" % (self.__class__.__name__, name))
AttributeError: 'Connection' object has no attribute 'nonetype'
fatal: [local]: FAILED! => {
    "msg": "Unexpected failure during module execution: 'Connection' object has no attribute 'nonetype'",
    "stdout": ""
}

(cherry picked from commit 4bddbe6)

ISSUE TYPE
  • Bugfix Pull Request
ADDITIONAL INFORMATION

…on tests (ansible#82954)

(cherry picked from commit 4bddbe6)

Co-authored-by: Jeroen van Bemmel <jvb127@gmail.com>
@ansibot ansibot added bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. backport This PR does not target the devel branch. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Apr 2, 2024
@sivel sivel merged commit 6ac75a2 into ansible:stable-2.16 Apr 10, 2024
78 checks passed
@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Apr 18, 2024
@ansible ansible locked and limited conversation to collaborators May 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport This PR does not target the devel branch. bug This issue/PR relates to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants