From cdec99168b6170302c233d8ac6aff960007c86b9 Mon Sep 17 00:00:00 2001 From: ocobleseqx Date: Thu, 20 Jul 2023 11:59:44 +0200 Subject: [PATCH] include 2nd device in API call even when both are same one Signed-off-by: ocobleseqx --- rest_l2_connection.go | 4 +--- rest_l2_connection_test.go | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/rest_l2_connection.go b/rest_l2_connection.go index c248c17..94aa431 100644 --- a/rest_l2_connection.go +++ b/rest_l2_connection.go @@ -211,9 +211,7 @@ func createL2RedundantConnectionRequest(primary L2Connection, secondary L2Connec connReq := createL2ConnectionRequest(primary) connReq.SecondaryName = secondary.Name connReq.SecondaryPortUUID = secondary.PortUUID - if StringValue(primary.DeviceUUID) != StringValue(secondary.DeviceUUID) { - connReq.SecondaryVirtualDeviceUUID = secondary.DeviceUUID - } + connReq.SecondaryVirtualDeviceUUID = secondary.DeviceUUID connReq.SecondaryVlanSTag = secondary.VlanSTag connReq.SecondaryVlanCTag = secondary.VlanCTag connReq.SecondaryZSidePortUUID = secondary.ZSidePortUUID diff --git a/rest_l2_connection_test.go b/rest_l2_connection_test.go index 2254774..5fced67 100644 --- a/rest_l2_connection_test.go +++ b/rest_l2_connection_test.go @@ -396,7 +396,7 @@ func TestCreateL2RedundantConnectionRequest_oneDevice(t *testing.T) { //when request := createL2RedundantConnectionRequest(primary, secondary) //then - assert.Nil(t, request.SecondaryVirtualDeviceUUID, "Secondary device UUID is not set") + assert.Equal(t, secondary.DeviceUUID, request.SecondaryVirtualDeviceUUID, "Secondary deviceUUID matches") assert.Equal(t, secondary.Name, request.SecondaryName, "Secondary name matches") assert.Equal(t, secondary.DeviceInterfaceID, request.SecondaryInterfaceID, "Secondary deviceInterfaceID name matches") }