Пример #1
0
    def update_network(self, context, id, network):
        """Update network.

        Perform this operation in the context of the configured device
        plugins.

        Note that the Nexus sub-plugin does not need to be notified
        (and the Nexus switch does not need to be [re]configured)
        for an update network operation because the Nexus sub-plugin
        is agnostic of all network-level attributes except the
        segmentation ID. Furthermore, updating of the segmentation ID
        is not supported by the OVS plugin since it is considered a
        provider attribute, so it is not supported by this method.
        """
        LOG.debug(_("update_network() called"))

        # We can only support updating of provider attributes if all the
        # configured sub-plugins support it. Currently we have no method
        # in place for checking whether a sub-plugin supports it,
        # so assume not.
        provider._raise_if_updates_provider_attributes(network['network'])

        args = [context, id, network]
        return self._invoke_plugin_per_device(const.VSWITCH_PLUGIN,
                                              self._func_name(),
                                              args)
Пример #2
0
 def update_network(self, context, network_id, network):
     pnet._raise_if_updates_provider_attributes(network["network"])
     # FIXME(arosen) - rollback...
     if "name" in network["network"]:
         self._set_network_name(network_id, network["network"]["name"])
     with context.session.begin(subtransactions=True):
         return super(OVNPlugin, self).update_network(context, network_id, network)
Пример #3
0
 def update_network(self, context, network_id, network):
     pnet._raise_if_updates_provider_attributes(network['network'])
     with context.session.begin(subtransactions=True):
         result = super(DFPlugin, self).update_network(context, network_id,
                                                       network)
         self._process_l3_update(context, result, network['network'])
     return result
Пример #4
0
 def update_network(self, context, network_id, network):
     pnet._raise_if_updates_provider_attributes(network["network"])
     # TODO(gsagie) rollback needed
     if "name" in network["network"]:
         self._set_network_name(network_id, network["network"]["name"])
     with context.session.begin(subtransactions=True):
         return super(DFPlugin, self).update_network(context, network_id, network)
Пример #5
0
    def update_network(self, context, id, network):
        LOG.debug(
            "MidonetPluginV2.update_network called: id=%(id)r, "
            "network=%(network)r", {
                'id': id,
                'network': network
            })

        # Disallow update of provider net
        net_data = network['network']
        pnet._raise_if_updates_provider_attributes(net_data)

        with context.session.begin(subtransactions=True):
            net = super(MidonetPluginV2,
                        self).update_network(context, id, network)
            self.extension_manager.process_update_network(
                context, net_data, net)
            self._process_l3_update(context, net, network['network'])
            self._extend_provider_network_dict(context, net)
            if psec.PORTSECURITY in network['network']:
                self._process_network_port_security_update(
                    context, network['network'], net)
            # NOTE(yamamoto): Retrieve the db object to get the correct
            # revision
            context.session.flush()
            net = self.get_network(context, id)
            self.client.update_network_precommit(context, id, net)

        self.client.update_network_postcommit(id, net)

        LOG.debug("MidonetPluginV2.update_network exiting: net=%r", net)
        return net
Пример #6
0
    def update_network(self, context, id, network):
        """Update network.

        Perform this operation in the context of the configured device
        plugins.

        Note that the Nexus sub-plugin does not need to be notified
        (and the Nexus switch does not need to be [re]configured)
        for an update network operation because the Nexus sub-plugin
        is agnostic of all network-level attributes except the
        segmentation ID. Furthermore, updating of the segmentation ID
        is not supported by the OVS plugin since it is considered a
        provider attribute, so it is not supported by this method.
        """
        LOG.debug(_("update_network() called"))

        # We can only support updating of provider attributes if all the
        # configured sub-plugins support it. Currently we have no method
        # in place for checking whether a sub-plugin supports it,
        # so assume not.
        provider._raise_if_updates_provider_attributes(network['network'])

        args = [context, id, network]
        ovs_output = self._invoke_plugin_per_device(const.VSWITCH_PLUGIN,
                                                    self._func_name(), args)
        return ovs_output[0]
Пример #7
0
 def update_network(self, context, network_id, network):
     pnet._raise_if_updates_provider_attributes(network['network'])
     # TODO(gsagie) rollback needed
     if 'name' in network['network']:
         self._set_network_name(network_id, network['network']['name'])
     with context.session.begin(subtransactions=True):
         return super(DFPlugin, self).update_network(context, network_id,
                                                     network)
Пример #8
0
 def update_network(self, context, network_id, network):
     pnet._raise_if_updates_provider_attributes(network['network'])
     # FIXME(arosen) - rollback...
     if 'name' in network['network']:
         self._set_network_name(network_id, network['network']['name'])
     with context.session.begin(subtransactions=True):
         return super(OVNPlugin,
                      self).update_network(context, network_id, network)
Пример #9
0
    def update_network(self, context, id, network):
        provider._raise_if_updates_provider_attributes(network["network"])

        session = context.session
        with session.begin(subtransactions=True):
            net = super(OVSNeutronPluginV2, self).update_network(context, id, network)
            self._process_l3_update(context, net, network["network"])
        return net
Пример #10
0
    def update_network(self, context, id, network):
        provider._raise_if_updates_provider_attributes(network['network'])

        session = context.session
        with session.begin(subtransactions=True):
            net = super(OVSNeutronPluginV2, self).update_network(context, id,
                                                                 network)
            self._process_l3_update(context, net, network['network'])
        return net
Пример #11
0
 def update_network(self, context, net_id, network):
     provider._raise_if_updates_provider_attributes(network['network'])
     session = context.session
     with session.begin(subtransactions=True):
         net = super(MellanoxEswitchPlugin,
                     self).update_network(context, net_id, network)
         self._process_l3_update(context, net, network['network'])
         self._extend_network_dict_provider(context, net)
     return net
Пример #12
0
 def update_network(self, context, network_id, network):
     pnet._raise_if_updates_provider_attributes(network['network'])
     # TODO(gsagie) rollback needed
     with context.session.begin(subtransactions=True):
         result = super(DFPlugin, self).update_network(context, network_id,
                                                       network)
         self._process_l3_update(context, result, network['network'])
         if 'name' in network['network']:
             self._set_network_name(network_id, network['network']['name'])
         return result
Пример #13
0
    def update_network(self, context, id, network):
        provider._raise_if_updates_provider_attributes(network['network'])

        session = context.session
        with session.begin(subtransactions=True):
            net = super(LinuxBridgePluginV2, self).update_network(context, id,
                                                                  network)
            self._process_l3_update(context, net, network['network'])
            self._extend_network_dict_provider(context, net)
        return net
Пример #14
0
    def update_network(self, context, net_id, network):
        LOG.debug(_("Update network"))
        provider._raise_if_updates_provider_attributes(network['network'])

        session = context.session
        with session.begin(subtransactions=True):
            net = super(MellanoxEswitchPlugin, self).update_network(context,
                                                                    net_id,
                                                                    network)
            self._process_l3_update(context, net, network['network'])
            self._extend_network_dict_provider(context, net)
        return net
Пример #15
0
    def update_network(self, context, id, network):
        net_attrs = network['network']
        providernet._raise_if_updates_provider_attributes(net_attrs)

        with db_api.context_manager.writer.using(context):
            net_res = super(NsxDvsV2,
                            self).update_network(context, id, network)
            # Process port security extension
            self._process_network_port_security_update(context, net_attrs,
                                                       net_res)
            self._extend_network_dict_provider(context, net_res)

        return net_res
Пример #16
0
    def update_network(self, context, id, network):
        net_attrs = network['network']
        pnet._raise_if_updates_provider_attributes(net_attrs)

        with context.session.begin(subtransactions=True):
            net_res = super(NsxDvsV2,
                            self).update_network(context, id, network)
            # Process port security extension
            self._process_network_port_security_update(context, net_attrs,
                                                       net_res)
            self._extend_network_dict_provider(context, net_res)

        return net_res
Пример #17
0
    def update_network(self, context, id, network):
        """Update network.

        Perform this operation in the context of the configured device
        plugins.
        """
        LOG.debug("update_network() called")

        # We can only support updating of provider attributes if all the
        # configured sub-plugins support it. Currently we have no method
        # in place for checking whether a sub-plugin supports it,
        # so assume not.
        provider._raise_if_updates_provider_attributes(network['network'])

        args = [context, id, network]
        return self._invoke_plugin_per_device(const.VSWITCH_PLUGIN,
                                              self._func_name(), args)
Пример #18
0
    def update_network(self, context, id, network):
        """Update network.

        Perform this operation in the context of the configured device
        plugins.
        """
        LOG.debug(_("update_network() called"))

        # We can only support updating of provider attributes if all the
        # configured sub-plugins support it. Currently we have no method
        # in place for checking whether a sub-plugin supports it,
        # so assume not.
        provider._raise_if_updates_provider_attributes(network['network'])

        args = [context, id, network]
        return self._invoke_plugin_per_device(const.VSWITCH_PLUGIN,
                                              self._func_name(),
                                              args)
Пример #19
0
    def update_network(self, context, network_id, network):
        pnet._raise_if_updates_provider_attributes(network['network'])
        with context.session.begin(subtransactions=True):
            result = super(DFPlugin,
                           self).update_network(context, network_id, network)
            if psec.PORTSECURITY in network['network']:
                self._process_network_port_security_update(
                    context, network['network'], result)
            self._process_l3_update(context, result, network['network'])
            network_version = version_db._update_db_version_row(
                context.session, network_id)

        self.nb_api.update_lswitch(id=network_id,
                                   topic=result['tenant_id'],
                                   name=result.get(
                                       'name',
                                       df_const.DF_NETWORK_DEFAULT_NAME),
                                   router_external=result['router:external'],
                                   version=network_version)
        return result
Пример #20
0
    def update_network(self, context, id, network):
        provider._raise_if_updates_provider_attributes(network["network"])

        session = context.session
        with session.begin(subtransactions=True):
            original_network = super(Ml2Plugin, self).get_network(context, id)
            updated_network = super(Ml2Plugin, self).update_network(context, id, network)
            self._process_l3_update(context, updated_network, network["network"])
            self._extend_network_dict_provider(context, updated_network)
            mech_context = driver_context.NetworkContext(
                self, context, updated_network, original_network=original_network
            )
            self.mechanism_manager.update_network_precommit(mech_context)

        # TODO(apech) - handle errors raised by update_network, potentially
        # by re-calling update_network with the previous attributes. For
        # now the error is propogated to the caller, which is expected to
        # either undo/retry the operation or delete the resource.
        self.mechanism_manager.update_network_postcommit(mech_context)
        return updated_network
Пример #21
0
    def update_network(self, context, id, network):
        LOG.debug(
            "MidonetPluginV2.update_network called: id=%(id)r, " "network=%(network)r", {"id": id, "network": network}
        )

        # Disallow update of provider net
        net_data = network["network"]
        pnet._raise_if_updates_provider_attributes(net_data)

        with context.session.begin(subtransactions=True):
            net = super(MidonetPluginV2, self).update_network(context, id, network)
            self._process_l3_update(context, net, network["network"])
            self._extend_provider_network_dict(context, net)
            if psec.PORTSECURITY in network["network"]:
                self._process_network_port_security_update(context, network["network"], net)
            self.client.update_network_precommit(context, id, net)

        self.client.update_network_postcommit(id, net)

        LOG.debug("MidonetPluginV2.update_network exiting: net=%r", net)
        return net
Пример #22
0
    def update_network(self, context, network_id, network):
        pnet._raise_if_updates_provider_attributes(network['network'])
        with context.session.begin(subtransactions=True):
            result = super(DFPlugin, self).update_network(context, network_id,
                                                          network)
            if psec.PORTSECURITY in network['network']:
                self._process_network_port_security_update(context,
                                                           network['network'],
                                                           result)
            self._process_l3_update(context, result, network['network'])
            network_version = version_db._update_db_version_row(
                    context.session, network_id)

        self.nb_api.update_lswitch(id=network_id,
                                   topic=result['tenant_id'],
                                   name=result.get(
                                           'name',
                                           df_const.DF_NETWORK_DEFAULT_NAME),
                                   router_external=result['router:external'],
                                   version=network_version)
        return result
Пример #23
0
    def update_network(self, context, id, network):
        provider._raise_if_updates_provider_attributes(network['network'])

        session = context.session
        with session.begin(subtransactions=True):
            original_network = super(Ml2Plugin, self).get_network(context, id)
            updated_network = super(Ml2Plugin, self).update_network(context,
                                                                    id,
                                                                    network)
            self._process_l3_update(context, updated_network,
                                    network['network'])
            self._extend_network_dict_provider(context, updated_network)
            mech_context = driver_context.NetworkContext(
                self, context, updated_network,
                original_network=original_network)
            self.mechanism_manager.update_network_precommit(mech_context)

        # TODO(apech) - handle errors raised by update_network, potentially
        # by re-calling update_network with the previous attributes. For
        # now the error is propogated to the caller, which is expected to
        # either undo/retry the operation or delete the resource.
        self.mechanism_manager.update_network_postcommit(mech_context)
        return updated_network