Fix sanity check for supported mechanism types by the forwarding plane
@@ -251,9 +251,6 @@ func SanityCheckConnectionType(mechanisms *Mechanisms, crossConnect *crossconnec
break
}
}
- if !localFound {
- return fmt.Errorf("connection type not supported by the forwarding plane - local")
- }
/* Verify remote mechanisms */
for _, mech := range mechanisms.RemoteMechanisms {
if crossConnect.GetRemoteSource().GetMechanism().GetType() == mech.GetType() || crossConnect.GetRemoteDestination().GetMechanism().GetType() == mech.GetType() {
@@ -261,8 +258,9 @@ func SanityCheckConnectionType(mechanisms *Mechanisms, crossConnect *crossconnec
break
}
}
- if !remoteFound {
- return fmt.Errorf("connection type not supported by the forwarding plane - remote")
+ /* If none of them matched, mechanism is not supported by the forwarding plane */
+ if !localFound && !remoteFound {
+ return fmt.Errorf("connection mechanism type not supported by the forwarding plane")
}
return nil
}
