Skip to content

Commit

Permalink
report smaller diffs by dropping null values.
Browse files Browse the repository at this point in the history
This should result in not showing fields that were unset to begin with,
and mark fields that were explicitly removed as "deleted" instead of
"replaced by ``null``"
  • Loading branch information
evgeni committed May 2, 2022
1 parent 7b554b2 commit 96e5b92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/smaller-diffs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- all modules - report smaller diffs by dropping ``null`` values. This should result in not showing fields that were unset to begin with, and mark fields that were explicitly removed as "deleted" instead of "replaced by ``null``"
4 changes: 2 additions & 2 deletions plugins/module_utils/foreman_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,10 +946,10 @@ def auto_lookup_nested_entities(self):
item[nested_key] = self._lookup_entity(item[nested_key], nested_spec)

def record_before(self, resource, entity):
self._before[resource].append(entity)
self._before[resource].append(_recursive_dict_without_none(entity))

def record_after(self, resource, entity):
self._after[resource].append(entity)
self._after[resource].append(_recursive_dict_without_none(entity))

def record_after_full(self, resource, entity):
self._after_full[resource].append(entity)
Expand Down

0 comments on commit 96e5b92

Please sign in to comment.