From e23c87cfc485b1bb4ab383e28f87ec30558f45dc Mon Sep 17 00:00:00 2001 From: Jaykumar Chhatbar <45447272+JchhatbarInfoblox@users.noreply.github.com> Date: Fri, 12 Jul 2024 09:47:00 +0530 Subject: [PATCH] [FIX] added check for list element match. (#239) --- plugins/module_utils/api.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/module_utils/api.py b/plugins/module_utils/api.py index c95c8df6..4ba56feb 100644 --- a/plugins/module_utils/api.py +++ b/plugins/module_utils/api.py @@ -645,6 +645,10 @@ def compare_objects(self, current_object, proposed_object): if not self.issubset(subitem, current_item): return False + # If the lists are of a different length the objects and order of element mismatch + if proposed_item != current_item: + return False + elif isinstance(proposed_item, dict): # Compare the items of the dict to see if they are equal. A # difference stops the comparison and returns false. If they