mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
Allow persistent connection plugins to queue messages back to ansible-connection (#49977)
* Connections can queue messages to be returned from ansible-connection * Provide fallback for invalid display level * Strip display from plugins * Route messages through helper method to try to avoid improper appends
This commit is contained in:
parent
49993a55e5
commit
1829a72885
13 changed files with 75 additions and 83 deletions
|
@ -32,9 +32,6 @@ from ansible.module_utils._text import to_text
|
|||
from ansible.module_utils.connection import ConnectionError
|
||||
from ansible.module_utils.network.common.utils import to_list
|
||||
from ansible.plugins.httpapi import HttpApiBase
|
||||
from ansible.utils.display import Display
|
||||
|
||||
display = Display()
|
||||
|
||||
|
||||
OPTIONS = {
|
||||
|
@ -73,7 +70,7 @@ class HttpApi(HttpApiBase):
|
|||
def send_request(self, data, **message_kwargs):
|
||||
data = to_list(data)
|
||||
if self._become:
|
||||
display.vvvv('firing event: on_become')
|
||||
self.connection.queue_message('vvvv', 'firing event: on_become')
|
||||
data.insert(0, {"cmd": "enable", "input": self._become_pass})
|
||||
|
||||
output = message_kwargs.get('output', 'text')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue