Resolve "Failed network element creation leads to the return of false error messages"
Merged
requested to merge 330-failed-network-element-creation-leads-to-the-return-of-false-error-messages into master
Compare changes
- Malte Bauch authored
Typos in combination with copy paste resulted in the return of faulty error messages after cleaning up plugins in the `addMne` method of `controller/northbound/server/networkelement.go`. The clean up of plugins after something went wrong while creating a managed network element, has been moved into a `defer` function. So if an error is thrown and a plugin has already been created and started, the defer function will stop the plugin and remove the corresponding files.
@@ -24,6 +24,7 @@ import (
@@ -24,6 +24,7 @@ import (
@@ -568,8 +569,18 @@ func (n *NetworkElementServer) AddList(ctx context.Context, request *mnepb.AddLi
@@ -568,8 +569,18 @@ func (n *NetworkElementServer) AddList(ctx context.Context, request *mnepb.AddLi
func (n *NetworkElementServer) addMne(ctx context.Context, name string, opt *tpb.TransportOption, requestPluginFunc func(uuid.UUID) (plugin.Plugin, error), pluginID uuid.UUID, pndID uuid.UUID, optionalNetworkElementID ...uuid.UUID) (uuid.UUID, error) {
@@ -580,38 +591,29 @@ func (n *NetworkElementServer) addMne(ctx context.Context, name string, opt *tpb
@@ -580,38 +591,29 @@ func (n *NetworkElementServer) addMne(ctx context.Context, name string, opt *tpb
mne, err := nucleus.NewNetworkElement(name, networkElementID, opt, pndID, plugin, conflict.Metadata{ResourceVersion: 0})
@@ -620,10 +622,8 @@ func (n *NetworkElementServer) addMne(ctx context.Context, name string, opt *tpb
@@ -620,10 +622,8 @@ func (n *NetworkElementServer) addMne(ctx context.Context, name string, opt *tpb
@@ -632,17 +632,11 @@ func (n *NetworkElementServer) addMne(ctx context.Context, name string, opt *tpb
@@ -632,17 +632,11 @@ func (n *NetworkElementServer) addMne(ctx context.Context, name string, opt *tpb
func (n *NetworkElementServer) initialNetworkElementRootPathRequest(ctx context.Context, mne networkelement.NetworkElement, plugin plugin.Plugin) error {