From b94dad5662b94584568998cfd2b9276ade0376f9 Mon Sep 17 00:00:00 2001 From: Pierre Lafievre Date: Tue, 14 Dec 2021 17:44:45 +0100 Subject: [PATCH] B #5663: GOCA - fix vnet reserve method (#5664) Signed-off-by: Pierre Lafievre (cherry picked from commit 0b269ff792bbd28e4adca9f09d13e7baf7a258bd) --- src/oca/go/src/goca/virtualnetwork.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/oca/go/src/goca/virtualnetwork.go b/src/oca/go/src/goca/virtualnetwork.go index 90fd07fde2d..b49a321f9db 100644 --- a/src/oca/go/src/goca/virtualnetwork.go +++ b/src/oca/go/src/goca/virtualnetwork.go @@ -160,7 +160,11 @@ func (vc *VirtualNetworkController) UpdateAR(tpl string) error { // * tpl: Template func (vc *VirtualNetworkController) Reserve(tpl string) (int, error) { response, err := vc.c.Client.Call("one.vn.reserve", vc.ID, tpl) - return response.BodyInt(), err + if err != nil { + return -1, err + } + + return response.BodyInt(), nil } // FreeAR frees a reserved address range from a virtual network.