mirror of
https://github.com/ansible/awx.git
synced 2026-01-22 23:18:03 -03:30
Merge pull request #5989 from jangsutsr/5986_prevent_unexpected_callback_module_attribute_warning
Prevent unexpected callback module attribute warning
This commit is contained in:
commit
9027616420
@ -86,7 +86,19 @@ def executor(tmpdir_factory, request):
|
||||
- name: Hello Message
|
||||
debug:
|
||||
msg: "Hello World!"
|
||||
'''} # noqa
|
||||
'''}, # noqa
|
||||
{'results_included.yml': '''
|
||||
- name: Run module which generates results list
|
||||
connection: local
|
||||
hosts: all
|
||||
gather_facts: no
|
||||
vars:
|
||||
results: ['foo', 'bar']
|
||||
tasks:
|
||||
- name: Generate results list
|
||||
debug:
|
||||
var: results
|
||||
'''}, # noqa
|
||||
])
|
||||
def test_callback_plugin_receives_events(executor, cache, event, playbook):
|
||||
executor.run()
|
||||
|
||||
@ -63,7 +63,6 @@ class BaseCallbackModule(CallbackBase):
|
||||
|
||||
@contextlib.contextmanager
|
||||
def capture_event_data(self, event, **event_data):
|
||||
|
||||
event_data.setdefault('uuid', str(uuid.uuid4()))
|
||||
|
||||
if event not in self.EVENTS_WITHOUT_TASK:
|
||||
@ -75,7 +74,7 @@ class BaseCallbackModule(CallbackBase):
|
||||
if event_data['res'].get('_ansible_no_log', False):
|
||||
event_data['res'] = {'censored': CENSORED}
|
||||
for i, item in enumerate(event_data['res'].get('results', [])):
|
||||
if event_data['res']['results'][i].get('_ansible_no_log', False):
|
||||
if isinstance(item, dict) and item.get('_ansible_no_log', False):
|
||||
event_data['res']['results'][i] = {'censored': CENSORED}
|
||||
|
||||
with event_context.display_lock:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user