From f99460f3efe3023f293fdca874c8e4022bd70fa1 Mon Sep 17 00:00:00 2001 From: Patrick Stephen Date: Mon, 16 Nov 2020 10:37:20 -0600 Subject: [PATCH] terraform-provider-sdm: remove empty id from resource create errors GitOrigin-RevId: 625ae47e2f14b140305353051da2bfb674949e70 --- sdm/resource_account.go | 2 +- sdm/resource_account_attachment.go | 2 +- sdm/resource_account_grant.go | 2 +- sdm/resource_node.go | 2 +- sdm/resource_role.go | 2 +- sdm/resource_role_attachment.go | 2 +- sdm/resource_role_grant.go | 2 +- sdm/resource_secret_store.go | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sdm/resource_account.go b/sdm/resource_account.go index 57ec378f..339c7c2c 100644 --- a/sdm/resource_account.go +++ b/sdm/resource_account.go @@ -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) { diff --git a/sdm/resource_account_attachment.go b/sdm/resource_account_attachment.go index 1ec8f119..8c6ab6cc 100644 --- a/sdm/resource_account_attachment.go +++ b/sdm/resource_account_attachment.go @@ -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 diff --git a/sdm/resource_account_grant.go b/sdm/resource_account_grant.go index 36b3a07b..9d1e45fb 100644 --- a/sdm/resource_account_grant.go +++ b/sdm/resource_account_grant.go @@ -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 diff --git a/sdm/resource_node.go b/sdm/resource_node.go index 76523f05..a63acf62 100644 --- a/sdm/resource_node.go +++ b/sdm/resource_node.go @@ -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) { diff --git a/sdm/resource_role.go b/sdm/resource_role.go index 1fa765b5..ce9b4274 100644 --- a/sdm/resource_role.go +++ b/sdm/resource_role.go @@ -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 diff --git a/sdm/resource_role_attachment.go b/sdm/resource_role_attachment.go index 03d6e662..fa2ab1c0 100644 --- a/sdm/resource_role_attachment.go +++ b/sdm/resource_role_attachment.go @@ -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 diff --git a/sdm/resource_role_grant.go b/sdm/resource_role_grant.go index 88f97219..5f218bc4 100644 --- a/sdm/resource_role_grant.go +++ b/sdm/resource_role_grant.go @@ -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 diff --git a/sdm/resource_secret_store.go b/sdm/resource_secret_store.go index 7596c31c..6c239b0e 100644 --- a/sdm/resource_secret_store.go +++ b/sdm/resource_secret_store.go @@ -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) {