Compare commits

...

6 commits

Author SHA1 Message Date
Silejonu
7521131ff7
Merge 9ec1d668b4 into c273ac2a01 2025-07-08 08:37:30 +02:00
softwarefactory-project-zuul[bot]
c273ac2a01
Merge pull request #650 from felixfontein/callback
profile_* callbacks: avoid deprecated/deleted functions

SUMMARY
The profile_roles and profile_tasks callbacks define methods playbook_on_setup and playbook_on_stats which have been deleted/deprecated:

playbook_on_stats has been deprecated, v2_playbook_on_stats should be used instead (that one has already been there for many years: ansible/ansible@ba0e532 was added in 2015).
playbook_on_setup has been deleted (ansible/ansible@eec57ec), and its v2 variant was already deleted in 2017: ansible/ansible@59d5481

Ref: #635
ISSUE TYPE

Bugfix Pull Request
Feature Pull Request

COMPONENT NAME
profile_roles
profile_tasks

Reviewed-by: Abhijeet Kasurde
Reviewed-by: Hideki Saito <saito@fgrep.org>
2025-07-08 05:47:53 +00:00
Felix Fontein
f978998521 Add changelog fragment. 2025-06-28 16:34:47 +02:00
Felix Fontein
c319c856ed Avoid deprecated/deleted callback functions. 2025-06-28 16:29:29 +02:00
Silejonu
9ec1d668b4 refactor(acl): improve execution speed 2025-06-05 08:54:42 +02:00
Silejonu
392fd0deaa fix(acl): correctly assert needed changes when recursive is true 2025-05-10 09:59:10 +02:00
5 changed files with 11 additions and 13 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- acl - correctly assert needed changes when pointing to a directory and recursive is set to true.

View file

@ -0,0 +1,2 @@
minor_changes:
- "profile_tasks and profile_roles callback plugins - avoid deleted/deprecated callback functions, instead use modern interface that was introduced a longer time ago (https://github.com/ansible-collections/ansible.posix/issues/650)."

View file

@ -124,10 +124,7 @@ class CallbackModule(CallbackBase):
def v2_playbook_on_handler_task_start(self, task):
self._record_task(task)
def playbook_on_setup(self):
self._display_tasktime()
def playbook_on_stats(self, stats):
def v2_playbook_on_stats(self, stats):
# Align summary report header with other callback plugin summary
self._display.banner("ROLES RECAP")

View file

@ -209,10 +209,7 @@ class CallbackModule(CallbackBase):
def v2_playbook_on_handler_task_start(self, task):
self._record_task(task)
def playbook_on_setup(self):
self._display_tasktime()
def playbook_on_stats(self, stats):
def v2_playbook_on_stats(self, stats):
# Align summary report header with other callback plugin summary
self._display.banner("TASKS RECAP")

View file

@ -244,16 +244,16 @@ def acl_changed(module, cmd, entry, use_nfsv4_acls=False):
lines = run_acl(module, cmd)
counter = 0
for line in lines:
if line.endswith('*,*') and not use_nfsv4_acls:
return False
if not use_nfsv4_acls and not line.endswith('*,*'):
return True
# if use_nfsv4_acls and entry is listed
if use_nfsv4_acls and entry == line:
counter += 1
# The current 'nfs4_setfacl --test' lists a new entry,
# which will be added at the top of list, followed by the existing entries.
# So if the entry has already been registered, the entry should be find twice.
if counter == 2:
# which will be added at the top of the list, followed by the existing entries.
# So if the entry has already been registered, the entry should be found twice.
if not use_nfsv4_acls or counter == 2:
return False
return True