def _validate_network_profile(self, net_p):
        if self._is_reserved_name(net_p["name"]):
            msg = _LE("Reserved name used for network profile name")
            LOG.error(msg)
            raise n_exc.InvalidInput(error_message=msg)
        if net_p["segment_type"] == "":
            msg = _LE("Arguments segment_type missing"
                      " for network profile %s") % net_p["name"]
            LOG.error(msg)
            raise n_exc.InvalidInput(error_message=msg)
        segment_type = net_p["segment_type"].lower()
        if segment_type == n1kv_const.CLI_SEG_TYPE_OVERLAY:
            # Convert from CLI to internal type
            segment_type = p_const.TYPE_VXLAN
            net_p["segment_type"] = p_const.TYPE_VXLAN
        if segment_type not in [p_const.TYPE_VLAN,
                                p_const.TYPE_VXLAN,
                                n1kv_const.TYPE_TRUNK]:
            msg = _LE("Segment_type should either be vlan, vxlan, "
                      "or trunk")
            LOG.error(msg)
            raise n_exc.InvalidInput(error_message=msg)
        if segment_type == p_const.TYPE_VLAN:
            if "physical_network" not in net_p:
                msg = _LE("Argument physical_network missing "
                          "for network profile %s") % net_p["name"]
                LOG.error(msg)
                raise n_exc.InvalidInput(error_message=msg)
        if segment_type in [n1kv_const.TYPE_TRUNK,
                            p_const.TYPE_VXLAN]:
            if not attributes.is_attr_set(net_p.get("sub_type")):
                msg = _LE("Argument sub_type missing "
                          "for network profile %s") % net_p["name"]
                LOG.error(msg)
                raise n_exc.InvalidInput(error_message=msg)
        if segment_type == p_const.TYPE_VXLAN:
            sub_type = net_p['sub_type']
            # Validate sub-type
            allowed_sub_types = [n1kv_const.CLI_VXLAN_MODE_NATIVE,
                                 n1kv_const.CLI_VXLAN_MODE_ENHANCED]
            if sub_type not in allowed_sub_types:
                msg = _LE("Sub_type should be either 'native' or 'enhanced'")
                LOG.error(msg)
                raise n_exc.InvalidInput(error_message=msg)
            if sub_type != n1kv_const.CLI_VXLAN_MODE_NATIVE:
                net_p['multicast_ip_range'] = '0.0.0.0'
            else:
                group_ip = cfg.CONF.ml2_type_vxlan.vxlan_group
                multicast_ip_range = net_p.get("multicast_ip_range")
                if not attributes.is_attr_set(multicast_ip_range):
                    if not group_ip:
                        msg = (_LE("Argument multicast_ip_range missing"
                                   " for VXLAN multicast network profile %s")
                               % net_p["name"])
                        LOG.error(msg)
                        raise n_exc.InvalidInput(error_message=msg)
                    else:
                        # Use the global value from conf
                        net_p['multicast_ip_range'] = "-".join(
                            [group_ip, group_ip])
                self._validate_multicast_ip_range(net_p)
        else:
            net_p['multicast_ip_range'] = '0.0.0.0'
A list of lists of open Data Viewers.
dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/plugins/ml2/drivers/cisco/n1kv/network_profile_service.py/NetworkProfile_db_mixin._validate_network_profile--crossover with--dataset/ETHPy150Open glue-viz/glue/glue/app/qt/application.py/GlueApplication.viewers