def _provision_network(self, port_id, net_uuid, network_type,
                           physical_network, segmentation_id):
        """Provision the network with the received information."""
        LOG.info("Provisioning network %s", net_uuid)

        vswitch_name = self._get_vswitch_name(network_type, physical_network)
        if network_type == h_constant.TYPE_VLAN:
            # Nothing to do
            pass
        elif network_type == h_constant.TYPE_FLAT:
            # Nothing to do
            pass
        elif network_type == h_constant.TYPE_LOCAL:
            # TODO(alexpilotti): Check that the switch type is private
            # or create it if not existing.
            pass
        elif network_type == h_constant.TYPE_NVGRE and self._nvgre_enabled:
            self._nvgre_ops.bind_nvgre_network(segmentation_id, net_uuid,
                                               vswitch_name)
        else:
            raise exception.NetworkingHyperVException(
                (_("Cannot provision unknown network type "
                   "%(network_type)s for network %(net_uuid)s") %
                 dict(network_type=network_type, net_uuid=net_uuid)))

        vswitch_map = {
            'network_type': network_type,
            'vswitch_name': vswitch_name,
            'ports': [],
            'vlan_id': segmentation_id}
        self._network_vswitch_map[net_uuid] = vswitch_map
def _provision_network ( self , port_id , net_uuid , network_type , physical_network , segmentation_id ) : LOG . info ( "Provisioning network %s" , net_uuid ) vswitch_name = self . _get_vswitch_name ( network_type , physical_network ) if network_type == h_constant . TYPE_VLAN : pass elif network_type == h_constant . TYPE_FLAT : pass elif network_type == h_constant . TYPE_LOCAL : pass elif network_type == h_constant . TYPE_NVGRE and self . _nvgre_enabled : self . _nvgre_ops . bind_nvgre_network ( segmentation_id , net_uuid , vswitch_name ) else : raise exception . NetworkingHyperVException ( ( _ ( "Cannot provision unknown network type " "%(network_type)s for network %(net_uuid)s" ) % dict ( network_type = network_type , net_uuid = net_uuid ) ) ) vswitch_map = { 'network_type' : network_type , 'vswitch_name' : vswitch_name , 'ports' : [ ] , 'vlan_id' : segmentation_id } self . _network_vswitch_map [ net_uuid ] = vswitch_map
Provision the network with the received information.