def check_calculated_network_cidr(self):
        nets_w_cidr = filter(lambda n: n['cidr'], self.networks)
        for ng in nets_w_cidr:
            calc_cidr_str = str(netaddr.IPNetwork(ng['cidr']).cidr)
            if calc_cidr_str != ng['cidr']:
                self.err_msgs.append(
                    u"Calculated CIDR ({0}) is different from value ({1}) "
                    u"set by user for network:\n{2}.".format(
                        calc_cidr_str, ng['cidr'], ng['name'])
                )
                self.result.append({
                    "ids": [int(ng["id"])],
                    "errors": ["cidr"]
                })
        self.expose_error_messages()
Check calculated networks CIDRs are equal to values set by user
dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/extensions/network_manager/checker.py/NetworkCheck.check_calculated_network_cidr