From 6a10514e086b839604d819cca8c2d19dd0362923 Mon Sep 17 00:00:00 2001 From: Chris Archibald Date: Fri, 22 Feb 2019 09:20:35 -0800 Subject: [PATCH] Bug Fix: Fix cmp in na_ontap_licence (#52284) * Revert "changes to clusteR" This reverts commit 33ee1b71e4bc8435fb315762a871f8c4cb6c5f80. * update to lisence * fix docs * Revert "Revert "changes to clusteR"" This reverts commit 8e56b999e6cf6a65de339e516f7134a6b6b39cba. --- .../modules/storage/netapp/na_ontap_license.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/storage/netapp/na_ontap_license.py b/lib/ansible/modules/storage/netapp/na_ontap_license.py index cb022f55ac7..cddcc842e08 100644 --- a/lib/ansible/modules/storage/netapp/na_ontap_license.py +++ b/lib/ansible/modules/storage/netapp/na_ontap_license.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# (c) 2018, NetApp, Inc +# (c) 2018-2019, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function @@ -137,7 +137,14 @@ HAS_NETAPP_LIB = netapp_utils.has_netapp_lib() def local_cmp(a, b): - return (a > b) - (a < b) + """ + compares with only values and not keys, keys should be the same for both dicts + :param a: dict 1 + :param b: dict 2 + :return: difference of values in both dicts + """ + diff = [key for key in a if a[key] != b[key]] + return len(diff) class NetAppOntapLicense(object):