Skip to content

Commit

Permalink
terraform-provider-sdm: remove empty id from resource create errors
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 625ae47e2f14b140305353051da2bfb674949e70
  • Loading branch information
200sc authored and SupportSDM committed Nov 18, 2020
1 parent 603ba89 commit f99460f
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion sdm/resource_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func resourceAccountCreate(d *schema.ResourceData, cc *sdm.Client) error {
localVersion := convertAccountFromResourceData(d)
resp, err := cc.Accounts().Create(ctx, localVersion)
if err != nil {
return fmt.Errorf("cannot create Account %s: %w", "", err)
return fmt.Errorf("cannot create Account: %w", err)
}
d.SetId(resp.Account.GetID())
switch v := resp.Account.(type) {
Expand Down
2 changes: 1 addition & 1 deletion sdm/resource_account_attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func resourceAccountAttachmentCreate(d *schema.ResourceData, cc *sdm.Client) err
localVersion := convertAccountAttachmentFromResourceData(d)
resp, err := cc.AccountAttachments().Create(ctx, localVersion)
if err != nil {
return fmt.Errorf("cannot create AccountAttachment %s: %w", "", err)
return fmt.Errorf("cannot create AccountAttachment: %w", err)
}
d.SetId(resp.AccountAttachment.ID)
v := resp.AccountAttachment
Expand Down
2 changes: 1 addition & 1 deletion sdm/resource_account_grant.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func resourceAccountGrantCreate(d *schema.ResourceData, cc *sdm.Client) error {
localVersion := convertAccountGrantFromResourceData(d)
resp, err := cc.AccountGrants().Create(ctx, localVersion)
if err != nil {
return fmt.Errorf("cannot create AccountGrant %s: %w", "", err)
return fmt.Errorf("cannot create AccountGrant: %w", err)
}
d.SetId(resp.AccountGrant.ID)
v := resp.AccountGrant
Expand Down
2 changes: 1 addition & 1 deletion sdm/resource_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func resourceNodeCreate(d *schema.ResourceData, cc *sdm.Client) error {
localVersion := convertNodeFromResourceData(d)
resp, err := cc.Nodes().Create(ctx, localVersion)
if err != nil {
return fmt.Errorf("cannot create Node %s: %w", "", err)
return fmt.Errorf("cannot create Node: %w", err)
}
d.SetId(resp.Node.GetID())
switch v := resp.Node.(type) {
Expand Down
2 changes: 1 addition & 1 deletion sdm/resource_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func resourceRoleCreate(d *schema.ResourceData, cc *sdm.Client) error {
localVersion := convertRoleFromResourceData(d)
resp, err := cc.Roles().Create(ctx, localVersion)
if err != nil {
return fmt.Errorf("cannot create Role %s: %w", "", err)
return fmt.Errorf("cannot create Role: %w", err)
}
d.SetId(resp.Role.ID)
v := resp.Role
Expand Down
2 changes: 1 addition & 1 deletion sdm/resource_role_attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func resourceRoleAttachmentCreate(d *schema.ResourceData, cc *sdm.Client) error
localVersion := convertRoleAttachmentFromResourceData(d)
resp, err := cc.RoleAttachments().Create(ctx, localVersion)
if err != nil {
return fmt.Errorf("cannot create RoleAttachment %s: %w", "", err)
return fmt.Errorf("cannot create RoleAttachment: %w", err)
}
d.SetId(resp.RoleAttachment.ID)
v := resp.RoleAttachment
Expand Down
2 changes: 1 addition & 1 deletion sdm/resource_role_grant.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func resourceRoleGrantCreate(d *schema.ResourceData, cc *sdm.Client) error {
localVersion := convertRoleGrantFromResourceData(d)
resp, err := cc.RoleGrants().Create(ctx, localVersion)
if err != nil {
return fmt.Errorf("cannot create RoleGrant %s: %w", "", err)
return fmt.Errorf("cannot create RoleGrant: %w", err)
}
d.SetId(resp.RoleGrant.ID)
v := resp.RoleGrant
Expand Down
2 changes: 1 addition & 1 deletion sdm/resource_secret_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func resourceSecretStoreCreate(d *schema.ResourceData, cc *sdm.Client) error {
localVersion := convertSecretStoreFromResourceData(d)
resp, err := cc.SecretStores().Create(ctx, localVersion)
if err != nil {
return fmt.Errorf("cannot create SecretStore %s: %w", "", err)
return fmt.Errorf("cannot create SecretStore: %w", err)
}
d.SetId(resp.SecretStore.GetID())
switch v := resp.SecretStore.(type) {
Expand Down

0 comments on commit f99460f

Please sign in to comment.