def network_create_event(self, network_info):
        net = network_info['network']
        net_id = net['id']
        self.network[net_id] = {}
        self.network[net_id].update(net)

        net_name = net.get('name')
        tenant_id = net.get('tenant_id')

        # Extract segmentation_id from the network name
        net_ext_name = self.cfg.dcnm.dcnm_net_ext
        nobj = re.search(net_ext_name, net_name)
        try:
            seg_id = int((net_name[nobj.start(0) + len(net_ext_name) - 1:]
                          if nobj else None))
        except (IndexError, TypeError, ValueError):
            seg_id = None

        # Check if network is already created.
        query_net = self.get_network_by_segid(seg_id) if seg_id else None
        if query_net:
            # The network is already created no need to process the event.
            if query_net.source.lower() == 'dcnm':
                # DCNM created the network. Only update network id in database.
                prev_id = query_net.network_id
                params = dict(columns=dict(network_id=net_id))
                self.update_network(prev_id, **params)

                # Update the network cache.
                prev_info = self.network.pop(prev_id)
                prev_info['id'] = net_id
                self.network[net_id] = prev_info

                # Update the network name. After extracting the segmentation_id
                # no need to keep it in the name. Removing it and update
                # the network.
                updated_net_name = (
                    net_name[:nobj.start(0) + len(net_ext_name) - 1])
                try:
                    body = {'network': {'name': updated_net_name, }}
                    dcnm_net = self.neutronclient.update_network(
                        net_id, body=body).get('network')
                    LOG.debug('Updated network %(network)s', dcnm_net)
                except Exception as exc:
                    LOG.exception(_LE('Failed to update network '
                                  '%(network)s. Reason %(err)s.'),
                                  {'network': updated_net_name,
                                   'err': str(exc)})
                    return

            LOG.info(_LI('network_create_event: network %(name)s was created '
                     'by %(source)s. Ignoring processing the event.'),
                     {'name': net_name, 'source': 'dcnm'})
            return

        # Check if project (i.e. tenant) exist.
        tenant_name = self.get_project_name(tenant_id)
        if not tenant_name:
            LOG.error(_LE('Failed to create network %(name)s. Project '
                      '%(tenant_id)s does not exist.'),
                      {'name': net_name, 'tenant_id': tenant_id})
            return

        pseg_id = self.network[net_id].get('provider:segmentation_id')
        seg_id = self._get_segmentation_id(pseg_id)
        self.network[net_id]['segmentation_id'] = seg_id
        try:
            cfgp, fwd_mod = self.dcnm_client.get_config_profile_for_network(
                net.get('name'))
            self.network[net_id]['config_profile'] = cfgp
            self.network[net_id]['fwd_mod'] = fwd_mod
            self.add_network_db(net_id, self.network[net_id],
                                'openstack',
                                constants.RESULT_SUCCESS)
            LOG.debug('network_create_event: network=%s', self.network)
        except dexc.DfaClientRequestFailed:
            # Fail to get config profile from DCNM.
            # Save the network info with failure result and send the request
            # to DCNM later.
            self.add_network_db(net_id, self.network[net_id], 'openstack',
                                constants.CREATE_FAIL)
            LOG.error(_LE('Failed to create network=%s.'), self.network)
Process network create event.
dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/apps/saf/server/dfa_server.py/DfaServer.network_create_event