Skip to content

Commit

Permalink
Merge pull request #10 from equinix/fix_secondary_connection_creation
Browse files Browse the repository at this point in the history
include 2nd device in API call even when both are same one
  • Loading branch information
ocobles authored Jul 20, 2023
2 parents d178d37 + cdec991 commit 8755d5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions rest_l2_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rest_l2_connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

0 comments on commit 8755d5f

Please sign in to comment.