Skip to content

Commit

Permalink
XML Utility: elements_equal (puzzle#86)
Browse files Browse the repository at this point in the history
* Drop ansible core devel python 3.7 support

* Make dict_to_etree exception more verbose

* Add elements_equal xml utility

* Lint xml utils sequence bool check

* Format changes
  • Loading branch information
DonGiovanni83 authored and KiLLuuuhh committed Apr 23, 2024
1 parent 7b0c7b9 commit 554dd7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/module_utils/xml_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def elements_equal(e1, e2) -> bool:
return False

# Leaf elements with no children
if not e1 and not e2:
if len(e1) == 0 and len(e2) == 0:
# 1. Check if texts are exactly the same (ignoring whitespaces and None)
# 2. or check if one text is '1' and the other is None with no children
return (
Expand Down

0 comments on commit 554dd7f

Please sign in to comment.