'Recursively compares dictionary contents equivalence, ignoring types and elements order.
Particularities of the comparison:
- Inexistent key = None
- These values are considered equal: None, empty, False
- Lists are compared value by value after a sort, if they have same size.
- Each element is converted to str before the comparison.
:arg dict first_resource: first dictionary
:arg dict second_resource: second dictionary
:return: bool: True when equal, False when different.'

def compare(self, first_resource, second_resource):

    resource1 = first_resource
    resource2 = second_resource
    debug_resources = 'resource1    =    {0},    resource2    =    {1}'.format(resource1, resource2)
    if (resource1 and (not resource2)):
        self.module.log(('resource1    and    not    resource2.    ' + debug_resources))
        return False
    for key in resource1:
        if (key not in resource2):
            if (resource1[key] is not None):
                self.module.log((self.MSG_DIFF_AT_KEY.format(key) + debug_resources))
                return False
        elif ((not resource1[key]) and (not resource2[key])):
            continue
        elif isinstance(resource1[key], collections.Mapping):
            if (not self.compare(resource1[key], resource2[key])):
                self.module.log((self.MSG_DIFF_AT_KEY.format(key) + debug_resources))
                return False
        elif isinstance(resource1[key], list):
            if (not self.compare_list(resource1[key], resource2[key])):
                self.module.log((self.MSG_DIFF_AT_KEY.format(key) + debug_resources))
                return False
        elif (_standardize_value(resource1[key]) != _standardize_value(resource2[key])):
            self.module.log((self.MSG_DIFF_AT_KEY.format(key) + debug_resources))
            return False
    for key in resource2.keys():
        if (key not in resource1):
            if (resource2[key] is not None):
                self.module.log((self.MSG_DIFF_AT_KEY.format(key) + debug_resources))
                return False
    return True
