mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -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
|
@ -1027,8 +1027,16 @@ class TaskExecutor:
|
|||
result = {'error': to_text(stderr, errors='surrogate_then_replace')}
|
||||
|
||||
if 'messages' in result:
|
||||
for msg in result.get('messages'):
|
||||
display.vvvv('%s' % msg, host=self._play_context.remote_addr)
|
||||
for level, message in result['messages']:
|
||||
if level == 'log':
|
||||
display.display(message, log_only=True)
|
||||
elif level in ('debug', 'v', 'vv', 'vvv', 'vvvv', 'vvvvv', 'vvvvvv'):
|
||||
getattr(display, level)(message, host=self._play_context.remote_addr)
|
||||
else:
|
||||
if hasattr(display, level):
|
||||
getattr(display, level)(message)
|
||||
else:
|
||||
display.vvvv(message, host=self._play_context.remote_addr)
|
||||
|
||||
if 'error' in result:
|
||||
if self._play_context.verbosity > 2:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue