Skip to content

Commit

Permalink
fix(cdo-ftd-device-onboarding-resource): Use the correct UID to wait …
Browse files Browse the repository at this point in the history
…for the FTDc Register State Machine to finish (#53)

We were previously using the specific device UID when we should have been using the device UID
  • Loading branch information
siddhuwarrier authored Sep 20, 2023
1 parent a0370ba commit 8f94ae4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions client/device/cloudftd/cloudftdonboarding/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package cloudftdonboarding
import (
"context"
"fmt"
"time"

"github.com/CiscoDevnet/terraform-provider-cdo/go-client/device/cloudfmc"
"github.com/CiscoDevnet/terraform-provider-cdo/go-client/device/cloudfmc/fmcconfig"
"github.com/CiscoDevnet/terraform-provider-cdo/go-client/device/cloudfmc/fmcplatform"
Expand All @@ -11,7 +13,6 @@ import (
"github.com/CiscoDevnet/terraform-provider-cdo/go-client/internal/retry"
"github.com/CiscoDevnet/terraform-provider-cdo/go-client/model/ftd/license"
"github.com/CiscoDevnet/terraform-provider-cdo/go-client/user"
"time"
)

type CreateInput struct {
Expand Down Expand Up @@ -106,7 +107,7 @@ func Create(ctx context.Context, client http.Client, createInp CreateInput) (*Cr
}

// 4. trigger FTD onboarding state machine
client.Logger.Println("triggering FTD onboarding state machine")
client.Logger.Println("triggering ftdcRegisterStateMachine")

// 4.1 get ftd specific device
ftdSpecificOutp, err := cloudftd.ReadSpecific(ctx, client, cloudftd.NewReadSpecificInputBuilder().Uid(readFtdOutp.Uid).Build())
Expand All @@ -129,7 +130,7 @@ func Create(ctx context.Context, client http.Client, createInp CreateInput) (*Cr
ctx,
client,
cloudftd.NewReadSpecificInputBuilder().
Uid(ftdSpecificOutp.SpecificUid).
Uid(readFtdOutp.Uid).
Build(),
),
retry.NewOptionsBuilder().
Expand Down

0 comments on commit 8f94ae4

Please sign in to comment.