@@ -289,7 +289,7 @@ func UpdatePortContext(ovs *libovsdb.OvsdbClient, portName string, key string, c
289289 return nil
290290}
291291
292- func AddInternalPort (ovs * libovsdb.OvsdbClient , bridgeName string , portName string , tag uint ) {
292+ func AddInternalPort (ovs * libovsdb.OvsdbClient , bridgeName string , portName string , tag uint ) error {
293293 namedPortUuid := "port"
294294 namedIntfUuid := "intf"
295295
@@ -339,14 +339,18 @@ func AddInternalPort(ovs *libovsdb.OvsdbClient, bridgeName string, portName stri
339339 reply , _ := ovs .Transact ("Open_vSwitch" , operations ... )
340340 if len (reply ) < len (operations ) {
341341 log .Error ("Number of Replies should be atleast equal to number of Operations" )
342+ return errors .New ("Number of Replies should be atleast equal to number of Operations" )
342343 }
343344 for i , o := range reply {
344345 if o .Error != "" && i < len (operations ) {
345- log .Errorf ("Transaction Failed due to an error : %v details: %v in %v" , o .Error , o .Details , operations [i ])
346+ msg := fmt .Sprintf ("Transaction Failed due to an error : %v details: %v in %v" , o .Error , o .Details , operations [i ])
347+ return errors .New (msg )
346348 } else if o .Error != "" {
347- log .Errorf ("Transaction Failed due to an error : %v" , o .Error )
349+ msg := fmt .Sprintf ("Transaction Failed due to an error : %v" , o .Error )
350+ return errors .New (msg )
348351 }
349352 }
353+ return nil
350354}
351355
352356func populateCache (updates libovsdb.TableUpdates ) {
0 commit comments