def _md5_hash_comparison(self, vsm_ip):
        # get md5 hashes from VSM here
        vsm_md5_dict = {}
        vsm_md5_properties = self._get_vsm_resource('md5_hashes', vsm_ip)[
            n1kv_const.MD5_HASHES][n1kv_const.PROPERTIES]
        (vsm_md5_dict[n1kv_const.NETWORK_PROFILES],
         vsm_md5_dict[n1kv_const.SUBNETS],
         vsm_md5_dict[n1kv_const.NETWORKS],
         vsm_md5_dict[n1kv_const.PORTS],
         vsm_consolidated_md5) = (
             vsm_md5_properties[n1kv_const.NETWORK_PROFILE_MD5],
             vsm_md5_properties[n1kv_const.SUBNET_MD5],
             vsm_md5_properties[n1kv_const.NETWORK_MD5],
             vsm_md5_properties[n1kv_const.PORT_MD5],
             vsm_md5_properties[n1kv_const.CONSOLIDATED_MD5])

        # order for resources has to be fixed as underneath since the
        # consolidated md5 depends on resource type order
        resources = [n1kv_const.NETWORK_PROFILES, n1kv_const.SUBNETS,
                     n1kv_const.NETWORKS, n1kv_const.PORTS]
        # update the consolidated md5 hash for Neutron
        neutron_consolidated_md5 = hashlib.md5()
        neutron_md5_dict = self._get_neutron_md5_dict()
        for res in resources:
            neutron_consolidated_md5.update(six.b(neutron_md5_dict[res]))

        # compare VSM and Neutron md5 hashes here
        if neutron_consolidated_md5.hexdigest() != vsm_consolidated_md5:
            LOG.debug('State mismatch detected for VSM %s.' % vsm_ip)
            for (res, neutron_md5_hash) in neutron_md5_dict.items():
                is_match = neutron_md5_hash == vsm_md5_dict[res]
                LOG.debug('MD5 %(resource)s match: %(match)s' %
                          {'resource': res, 'match': is_match})
                if not is_match:
                    LOG.debug('Schedule sync for: %s' % res)
                    self.sync_resource[res] = True
                else:
                    self.sync_resource[res] = False
        else:
            for res in self.sync_resource.keys():
                self.sync_resource[res] = False
            LOG.debug("State in sync for VSM %s" % vsm_ip)
Compare md5 hashes between neutron and VSM.
dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/plugins/ml2/drivers/cisco/n1kv/n1kv_sync.py/N1kvSyncDriver._md5_hash_comparison