mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
* better mechanism for customizing "changed" behaviour
* dont drink and code: silly mistake from late at night
* added changelog fragment
(cherry picked from commit 2a376642dd
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
b2e4485567
commit
1f7047e725
2 changed files with 9 additions and 1 deletions
2
changelogs/fragments/2514-mh-improved-changed.yml
Normal file
2
changelogs/fragments/2514-mh-improved-changed.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
minor_changes:
|
||||
- ModuleHelper module utils - improved mechanism for customizing the calculation of ``changed`` (https://github.com/ansible-collections/community.general/pull/2514).
|
|
@ -33,9 +33,15 @@ class ModuleHelperBase(object):
|
|||
def __quit_module__(self):
|
||||
pass
|
||||
|
||||
def __changed__(self):
|
||||
raise NotImplementedError()
|
||||
|
||||
@property
|
||||
def changed(self):
|
||||
return self._changed
|
||||
try:
|
||||
return self.__changed__()
|
||||
except NotImplementedError:
|
||||
return self._changed
|
||||
|
||||
@changed.setter
|
||||
def changed(self, value):
|
||||
|
|
Loading…
Reference in a new issue