From b369786a3c9373f5685169dbf29a9c4eac22a161 Mon Sep 17 00:00:00 2001 From: Lionel Hercot Date: Thu, 12 May 2022 16:18:16 -0700 Subject: [PATCH] [bugfix] Fix all Read() to not fail if object does not exist. --- aci/data_source_aci_isisdompol.go | 2 +- aci/resource_aci_aaa_domain_relationship.go | 2 +- aci/resource_aci_aaaauthrealm.go | 6 +++--- aci/resource_aci_aaaconsoleauth.go | 2 +- aci/resource_aci_aaadefaultauth.go | 2 +- aci/resource_aci_aaaduoprovidergroup.go | 2 +- aci/resource_aci_aaaldapgroupmap.go | 2 +- aci/resource_aci_aaaldapgroupmaprule.go | 2 +- aci/resource_aci_aaaldapgroupmapruleref.go | 2 +- aci/resource_aci_aaaldapprovider.go | 2 +- aci/resource_aci_aaalogindomain.go | 4 ++-- aci/resource_aci_aaaproviderref.go | 2 +- aci/resource_aci_aaaradiusprovider.go | 2 +- aci/resource_aci_aaaradiusprovidergroup.go | 2 +- aci/resource_aci_aaarsaprovider.go | 2 +- aci/resource_aci_aaasamlprovider.go | 2 +- aci/resource_aci_aaasamlprovidergroup.go | 2 +- aci/resource_aci_aaatacacsplusprovider.go | 2 +- aci/resource_aci_aaatacacsplusprovidergroup.go | 2 +- aci/resource_aci_aaausercert.go | 2 +- aci/resource_aci_aaauserdomain.go | 2 +- aci/resource_aci_aaauserep.go | 2 +- aci/resource_aci_aaauserrole.go | 2 +- aci/resource_aci_cooppol.go | 2 +- aci/resource_aci_edrerrdisrecoverpol.go | 2 +- aci/resource_aci_epcontrolp.go | 2 +- aci/resource_aci_epipagingp.go | 2 +- aci/resource_aci_eploopprotectp.go | 2 +- aci/resource_aci_fabricnodecontrol.go | 2 +- aci/resource_aci_fabricrsoospath.go | 2 +- aci/resource_aci_fileremotepath.go | 2 +- aci/resource_aci_fvepgselector.go | 2 +- aci/resource_aci_fvepselector.go | 4 ++-- aci/resource_aci_fvesg.go | 4 ++-- aci/resource_aci_fvrsconsif.go | 2 +- aci/resource_aci_fvrsctxtobgpctxafpol.go | 2 +- aci/resource_aci_fvtagselector.go | 4 ++-- aci/resource_aci_infraaccnodepgrp.go | 2 +- aci/resource_aci_infraporttrackpol.go | 2 +- aci/resource_aci_infrarsdomp.go | 2 +- aci/resource_aci_infrasetpol.go | 2 +- aci/resource_aci_infrashports.go | 2 +- aci/resource_aci_infraspineaccnodepgrp.go | 2 +- aci/resource_aci_isisdompol.go | 2 +- aci/resource_aci_mcpinstpol.go | 2 +- aci/resource_aci_mgmtconnectivityprefs.go | 2 +- aci/resource_aci_mgmtgrp.go | 2 +- aci/resource_aci_mgmtinboobzone.go | 4 ++-- aci/resource_aci_pkiexportencryptionkey.go | 2 +- aci/resource_aci_qosinstpol.go | 2 +- aci/resource_aci_rtctrlattrp.go | 2 +- aci/resource_aci_rtctrlctxp.go | 2 +- aci/resource_aci_rtctrlmatchcommregexterm.go | 2 +- aci/resource_aci_rtctrlmatchcommterm.go | 2 +- aci/resource_aci_rtctrlmatchrtdest.go | 2 +- aci/resource_aci_rtctrlsetaddcomm.go | 2 +- aci/resource_aci_rtctrlsubjp.go | 2 +- aci/resource_aci_snmpcommunityp.go | 2 +- aci/resource_aci_snmpcommunityp_deprecated.go | 2 +- aci/resource_aci_snmpctxp.go | 2 +- aci/resource_aci_stpifpol.go | 4 ++-- aci/resource_aci_tacacsgroup.go | 2 +- aci/resource_aci_tacacssrc.go | 2 +- aci/resource_aci_tacacstacacsdest.go | 2 +- aci/resource_aci_tagannotation.go | 2 +- aci/resource_aci_tagtag.go | 2 +- aci/resource_aci_trigrecurrwindowp.go | 2 +- aci/resource_aci_vmmctrlrp.go | 4 ++-- aci/resource_aci_vmmusraccp.go | 2 +- aci/resource_aci_vmmvswitchpolicycont.go | 2 +- aci/resource_aci_vpcinstpol.go | 2 +- 71 files changed, 80 insertions(+), 80 deletions(-) diff --git a/aci/data_source_aci_isisdompol.go b/aci/data_source_aci_isisdompol.go index 220d832cc..607c02271 100644 --- a/aci/data_source_aci_isisdompol.go +++ b/aci/data_source_aci_isisdompol.go @@ -84,7 +84,7 @@ func dataSourceAciISISDomainPolicyRead(ctx context.Context, d *schema.ResourceDa isisDomPol, err := getRemoteISISDomainPolicy(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setISISDomainPolicyAttributes(isisDomPol, d) if err != nil { diff --git a/aci/resource_aci_aaa_domain_relationship.go b/aci/resource_aci_aaa_domain_relationship.go index f3ce4c5c8..79b59ac6a 100644 --- a/aci/resource_aci_aaa_domain_relationship.go +++ b/aci/resource_aci_aaa_domain_relationship.go @@ -120,7 +120,7 @@ func resourceAciDomainRelationshipRead(ctx context.Context, d *schema.ResourceDa aaaDomainRef, err := getRemoteAaaDomainRelationship(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setAaaDomainRelationshipAttributes(aaaDomainRef, d) diff --git a/aci/resource_aci_aaaauthrealm.go b/aci/resource_aci_aaaauthrealm.go index 06415377b..b32df9f69 100644 --- a/aci/resource_aci_aaaauthrealm.go +++ b/aci/resource_aci_aaaauthrealm.go @@ -249,7 +249,7 @@ func resourceAciAAAAuthenticationRead(ctx context.Context, d *schema.ResourceDat aaaAuthRealm, err := getRemoteAAAAuthentication(aciClient, dnauthrealm) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setAAAAuthenticationAttributes(aaaAuthRealm, d) if err != nil { @@ -260,12 +260,12 @@ func resourceAciAAAAuthenticationRead(ctx context.Context, d *schema.ResourceDat aaaPingEp, err := getRemoteDefaultRadiusAuthenticationSettings(aciClient, dnpingep) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setDefaultRadiusAuthenticationSettingsAttributes(aaaPingEp, d) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } log.Printf("[DEBUG] %s: Read finished successfully", d.Id()) return nil diff --git a/aci/resource_aci_aaaconsoleauth.go b/aci/resource_aci_aaaconsoleauth.go index d3e50fd3d..1262c8f3f 100644 --- a/aci/resource_aci_aaaconsoleauth.go +++ b/aci/resource_aci_aaaconsoleauth.go @@ -182,7 +182,7 @@ func resourceAciConsoleAuthenticationMethodRead(ctx context.Context, d *schema.R aaaConsoleAuth, err := getRemoteConsoleAuthenticationMethod(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setConsoleAuthenticationMethodAttributes(aaaConsoleAuth, d) if err != nil { diff --git a/aci/resource_aci_aaadefaultauth.go b/aci/resource_aci_aaadefaultauth.go index 71975bf38..3d429157a 100644 --- a/aci/resource_aci_aaadefaultauth.go +++ b/aci/resource_aci_aaadefaultauth.go @@ -206,7 +206,7 @@ func resourceAciDefaultAuthenticationMethodforallLoginsRead(ctx context.Context, aaaDefaultAuth, err := getRemoteDefaultAuthenticationMethodforallLogins(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setDefaultAuthenticationMethodforallLoginsAttributes(aaaDefaultAuth, d) if err != nil { diff --git a/aci/resource_aci_aaaduoprovidergroup.go b/aci/resource_aci_aaaduoprovidergroup.go index edcc2ad47..804cce945 100644 --- a/aci/resource_aci_aaaduoprovidergroup.go +++ b/aci/resource_aci_aaaduoprovidergroup.go @@ -254,7 +254,7 @@ func resourceAciDuoProviderGroupRead(ctx context.Context, d *schema.ResourceData aaaDuoProviderGroup, err := getRemoteDuoProviderGroup(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setDuoProviderGroupAttributes(aaaDuoProviderGroup, d) if err != nil { diff --git a/aci/resource_aci_aaaldapgroupmap.go b/aci/resource_aci_aaaldapgroupmap.go index b0e5d179b..efebec102 100644 --- a/aci/resource_aci_aaaldapgroupmap.go +++ b/aci/resource_aci_aaaldapgroupmap.go @@ -155,7 +155,7 @@ func resourceAciLDAPGroupMapRead(ctx context.Context, d *schema.ResourceData, m aaaLdapGroupMap, err := getRemoteLDAPGroupMap(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setLDAPGroupMapAttributes(aaaLdapGroupMap, d) if err != nil { diff --git a/aci/resource_aci_aaaldapgroupmaprule.go b/aci/resource_aci_aaaldapgroupmaprule.go index 5bb4854f7..19cf075d2 100644 --- a/aci/resource_aci_aaaldapgroupmaprule.go +++ b/aci/resource_aci_aaaldapgroupmaprule.go @@ -185,7 +185,7 @@ func resourceAciLDAPGroupMapRuleRead(ctx context.Context, d *schema.ResourceData aaaLdapGroupMapRule, err := getRemoteLDAPGroupMapRule(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } ldap_group_map_rule := strings.Split(dn, "/") diff --git a/aci/resource_aci_aaaldapgroupmapruleref.go b/aci/resource_aci_aaaldapgroupmapruleref.go index e0af90ec4..d01ea7ea5 100644 --- a/aci/resource_aci_aaaldapgroupmapruleref.go +++ b/aci/resource_aci_aaaldapgroupmapruleref.go @@ -154,7 +154,7 @@ func resourceAciLDAPGroupMaprulerefRead(ctx context.Context, d *schema.ResourceD aaaLdapGroupMapRuleRef, err := getRemoteLDAPGroupMapruleref(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setLDAPGroupMaprulerefAttributes(aaaLdapGroupMapRuleRef, d) if err != nil { diff --git a/aci/resource_aci_aaaldapprovider.go b/aci/resource_aci_aaaldapprovider.go index 97477564a..fba6c17bd 100644 --- a/aci/resource_aci_aaaldapprovider.go +++ b/aci/resource_aci_aaaldapprovider.go @@ -461,7 +461,7 @@ func resourceAciLDAPProviderRead(ctx context.Context, d *schema.ResourceData, m aaaLdapProvider, err := getRemoteLDAPProvider(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } ldap_provider_group := strings.Split(dn, "/") diff --git a/aci/resource_aci_aaalogindomain.go b/aci/resource_aci_aaalogindomain.go index 2afa4d83a..021991d0a 100644 --- a/aci/resource_aci_aaalogindomain.go +++ b/aci/resource_aci_aaalogindomain.go @@ -245,7 +245,7 @@ func resourceAciLoginDomainRead(ctx context.Context, d *schema.ResourceData, m i aaaLoginDomain, err := getRemoteLoginDomain(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setLoginDomainAttributes(aaaLoginDomain, d) if err != nil { @@ -256,7 +256,7 @@ func resourceAciLoginDomainRead(ctx context.Context, d *schema.ResourceData, m i aaaDomainAuth, err := getRemoteAuthenticationMethodfortheDomain(aciClient, childDn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setAuthenticationMethodfortheDomainAttributes(aaaDomainAuth, d) if err != nil { diff --git a/aci/resource_aci_aaaproviderref.go b/aci/resource_aci_aaaproviderref.go index 94368c92a..800b673ef 100644 --- a/aci/resource_aci_aaaproviderref.go +++ b/aci/resource_aci_aaaproviderref.go @@ -178,7 +178,7 @@ func resourceAciProviderGroupMemberRead(ctx context.Context, d *schema.ResourceD aaaProviderRef, err := getRemoteProviderGroupMember(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setProviderGroupMemberAttributes(aaaProviderRef, d) if err != nil { diff --git a/aci/resource_aci_aaaradiusprovider.go b/aci/resource_aci_aaaradiusprovider.go index 6ac3361c3..249d5adbe 100644 --- a/aci/resource_aci_aaaradiusprovider.go +++ b/aci/resource_aci_aaaradiusprovider.go @@ -395,7 +395,7 @@ func resourceAciRADIUSProviderRead(ctx context.Context, d *schema.ResourceData, aaaRadiusProvider, err := getRemoteRADIUSProvider(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } radius_provider_group := strings.Split(dn, "/") diff --git a/aci/resource_aci_aaaradiusprovidergroup.go b/aci/resource_aci_aaaradiusprovidergroup.go index 9cbc1f689..d3c767330 100644 --- a/aci/resource_aci_aaaradiusprovidergroup.go +++ b/aci/resource_aci_aaaradiusprovidergroup.go @@ -143,7 +143,7 @@ func resourceAciRADIUSProviderGroupRead(ctx context.Context, d *schema.ResourceD aaaRadiusProviderGroup, err := getRemoteRADIUSProviderGroup(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setRADIUSProviderGroupAttributes(aaaRadiusProviderGroup, d) if err != nil { diff --git a/aci/resource_aci_aaarsaprovider.go b/aci/resource_aci_aaarsaprovider.go index e6a221342..29bf2b03f 100644 --- a/aci/resource_aci_aaarsaprovider.go +++ b/aci/resource_aci_aaarsaprovider.go @@ -365,7 +365,7 @@ func resourceAciRSAProviderRead(ctx context.Context, d *schema.ResourceData, m i aaaRsaProvider, err := getRemoteRSAProvider(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setRSAProviderAttributes(aaaRsaProvider, d) if err != nil { diff --git a/aci/resource_aci_aaasamlprovider.go b/aci/resource_aci_aaasamlprovider.go index e2fe954a9..3de8705d9 100644 --- a/aci/resource_aci_aaasamlprovider.go +++ b/aci/resource_aci_aaasamlprovider.go @@ -513,7 +513,7 @@ func resourceAciSAMLProviderRead(ctx context.Context, d *schema.ResourceData, m aaaSamlProvider, err := getRemoteSAMLProvider(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setSAMLProviderAttributes(aaaSamlProvider, d) if err != nil { diff --git a/aci/resource_aci_aaasamlprovidergroup.go b/aci/resource_aci_aaasamlprovidergroup.go index 237a653e0..95a7f7c58 100644 --- a/aci/resource_aci_aaasamlprovidergroup.go +++ b/aci/resource_aci_aaasamlprovidergroup.go @@ -142,7 +142,7 @@ func resourceAciSAMLProviderGroupRead(ctx context.Context, d *schema.ResourceDat aaaSamlProviderGroup, err := getRemoteSAMLProviderGroup(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setSAMLProviderGroupAttributes(aaaSamlProviderGroup, d) if err != nil { diff --git a/aci/resource_aci_aaatacacsplusprovider.go b/aci/resource_aci_aaatacacsplusprovider.go index 56b21b8eb..f96764ae2 100644 --- a/aci/resource_aci_aaatacacsplusprovider.go +++ b/aci/resource_aci_aaatacacsplusprovider.go @@ -364,7 +364,7 @@ func resourceAciTACACSProviderRead(ctx context.Context, d *schema.ResourceData, aaaTacacsPlusProvider, err := getRemoteTACACSProvider(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setTACACSProviderAttributes(aaaTacacsPlusProvider, d) if err != nil { diff --git a/aci/resource_aci_aaatacacsplusprovidergroup.go b/aci/resource_aci_aaatacacsplusprovidergroup.go index 61487e261..91dab833b 100644 --- a/aci/resource_aci_aaatacacsplusprovidergroup.go +++ b/aci/resource_aci_aaatacacsplusprovidergroup.go @@ -143,7 +143,7 @@ func resourceAciTACACSPlusProviderGroupRead(ctx context.Context, d *schema.Resou aaaTacacsPlusProviderGroup, err := getRemoteTACACSPlusProviderGroup(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setTACACSPlusProviderGroupAttributes(aaaTacacsPlusProviderGroup, d) if err != nil { diff --git a/aci/resource_aci_aaausercert.go b/aci/resource_aci_aaausercert.go index eb7d703a3..2eac49d5b 100644 --- a/aci/resource_aci_aaausercert.go +++ b/aci/resource_aci_aaausercert.go @@ -200,7 +200,7 @@ func resourceAciX509CertificateRead(ctx context.Context, d *schema.ResourceData, if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setX509CertificateAttributes(aaaUserCert, d) if err != nil { diff --git a/aci/resource_aci_aaauserdomain.go b/aci/resource_aci_aaauserdomain.go index deadcf2a0..8e74f7fd1 100644 --- a/aci/resource_aci_aaauserdomain.go +++ b/aci/resource_aci_aaauserdomain.go @@ -154,7 +154,7 @@ func resourceAciUserDomainRead(ctx context.Context, d *schema.ResourceData, m in aaaUserDomain, err := getRemoteUserDomain(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setUserDomainAttributes(aaaUserDomain, d) if err != nil { diff --git a/aci/resource_aci_aaauserep.go b/aci/resource_aci_aaauserep.go index 164aa7d1a..2a6687483 100644 --- a/aci/resource_aci_aaauserep.go +++ b/aci/resource_aci_aaauserep.go @@ -621,7 +621,7 @@ func resourceAciUserManagementRead(ctx context.Context, d *schema.ResourceData, aaaUserEp, err := getRemoteUserManagement(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setUserManagementAttributes(aaaUserEp, d) if err != nil { diff --git a/aci/resource_aci_aaauserrole.go b/aci/resource_aci_aaauserrole.go index b8208e98e..8dc7043a0 100644 --- a/aci/resource_aci_aaauserrole.go +++ b/aci/resource_aci_aaauserrole.go @@ -171,7 +171,7 @@ func resourceAciUserRoleRead(ctx context.Context, d *schema.ResourceData, m inte aaaUserRole, err := getRemoteUserRole(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setUserRoleAttributes(aaaUserRole, d) if err != nil { diff --git a/aci/resource_aci_cooppol.go b/aci/resource_aci_cooppol.go index bd939ffc8..7992d4ccc 100644 --- a/aci/resource_aci_cooppol.go +++ b/aci/resource_aci_cooppol.go @@ -154,7 +154,7 @@ func resourceAciCOOPGroupPolicyRead(ctx context.Context, d *schema.ResourceData, coopPol, err := getRemoteCOOPGroupPolicy(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setCOOPGroupPolicyAttributes(coopPol, d) if err != nil { diff --git a/aci/resource_aci_edrerrdisrecoverpol.go b/aci/resource_aci_edrerrdisrecoverpol.go index 6c19c44aa..0061fe246 100644 --- a/aci/resource_aci_edrerrdisrecoverpol.go +++ b/aci/resource_aci_edrerrdisrecoverpol.go @@ -356,7 +356,7 @@ func resourceAciErrorDisabledRecoveryPolicyRead(ctx context.Context, d *schema.R edrErrDisRecoverPol, err := getRemoteErrorDisabledRecoveryPolicy(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setErrorDisabledRecoveryPolicyAttributes(edrErrDisRecoverPol, d) if err != nil { diff --git a/aci/resource_aci_epcontrolp.go b/aci/resource_aci_epcontrolp.go index 91a3bd280..58a491d5f 100644 --- a/aci/resource_aci_epcontrolp.go +++ b/aci/resource_aci_epcontrolp.go @@ -196,7 +196,7 @@ func resourceAciEndpointControlPolicyRead(ctx context.Context, d *schema.Resourc epControlP, err := getRemoteEndpointControlPolicy(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setEndpointControlPolicyAttributes(epControlP, d) if err != nil { diff --git a/aci/resource_aci_epipagingp.go b/aci/resource_aci_epipagingp.go index aa985a656..0b6282881 100644 --- a/aci/resource_aci_epipagingp.go +++ b/aci/resource_aci_epipagingp.go @@ -155,7 +155,7 @@ func resourceAciIPAgingPolicyRead(ctx context.Context, d *schema.ResourceData, m epIpAgingP, err := getRemoteIPAgingPolicy(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setIPAgingPolicyAttributes(epIpAgingP, d) if err != nil { diff --git a/aci/resource_aci_eploopprotectp.go b/aci/resource_aci_eploopprotectp.go index 37becb3e0..6edd2ca78 100644 --- a/aci/resource_aci_eploopprotectp.go +++ b/aci/resource_aci_eploopprotectp.go @@ -242,7 +242,7 @@ func resourceAciEPLoopProtectionPolicyRead(ctx context.Context, d *schema.Resour epLoopProtectP, err := getRemoteEPLoopProtectionPolicy(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setEPLoopProtectionPolicyAttributes(epLoopProtectP, d) if err != nil { diff --git a/aci/resource_aci_fabricnodecontrol.go b/aci/resource_aci_fabricnodecontrol.go index e620d3bc3..3468f9cd1 100644 --- a/aci/resource_aci_fabricnodecontrol.go +++ b/aci/resource_aci_fabricnodecontrol.go @@ -190,7 +190,7 @@ func resourceAciFabricNodeControlRead(ctx context.Context, d *schema.ResourceDat fabricNodeControl, err := getRemoteFabricNodeControl(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setFabricNodeControlAttributes(fabricNodeControl, d) if err != nil { diff --git a/aci/resource_aci_fabricrsoospath.go b/aci/resource_aci_fabricrsoospath.go index c30940be2..2fab94196 100644 --- a/aci/resource_aci_fabricrsoospath.go +++ b/aci/resource_aci_fabricrsoospath.go @@ -220,7 +220,7 @@ func resourceAciOutofServiceFabricPathRead(ctx context.Context, d *schema.Resour fabricRsOosPath, err := getRemoteOutofServiceFabricPath(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setOutofServiceFabricPathAttributes(fabricRsOosPath, d) if err != nil { diff --git a/aci/resource_aci_fileremotepath.go b/aci/resource_aci_fileremotepath.go index 39d3ce364..b9cf574e3 100644 --- a/aci/resource_aci_fileremotepath.go +++ b/aci/resource_aci_fileremotepath.go @@ -411,7 +411,7 @@ func resourceAciRemotePathofaFileRead(ctx context.Context, d *schema.ResourceDat fileRemotePath, err := getRemoteRemotePathofaFile(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } setRemotePathofaFileAttributes(fileRemotePath, d) diff --git a/aci/resource_aci_fvepgselector.go b/aci/resource_aci_fvepgselector.go index 9d88fa5e7..16de222d9 100644 --- a/aci/resource_aci_fvepgselector.go +++ b/aci/resource_aci_fvepgselector.go @@ -165,7 +165,7 @@ func resourceAciEndpointSecurityGroupEPgSelectorRead(ctx context.Context, d *sch fvEPgSelector, err := getRemoteEndpointSecurityGroupEPgSelector(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setEndpointSecurityGroupEPgSelectorAttributes(fvEPgSelector, d) if err != nil { diff --git a/aci/resource_aci_fvepselector.go b/aci/resource_aci_fvepselector.go index 4f7ed8c74..d4f605a7c 100644 --- a/aci/resource_aci_fvepselector.go +++ b/aci/resource_aci_fvepselector.go @@ -168,12 +168,12 @@ func resourceAciEndpointSecurityGroupSelectorRead(ctx context.Context, d *schema fvEPSelector, err := getRemoteEndpointSecurityGroupSelector(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setEndpointSecurityGroupSelectorAttributes(fvEPSelector, d) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } log.Printf("[DEBUG] %s: Read finished successfully", d.Id()) diff --git a/aci/resource_aci_fvesg.go b/aci/resource_aci_fvesg.go index 0e653ec63..fa133f22c 100644 --- a/aci/resource_aci_fvesg.go +++ b/aci/resource_aci_fvesg.go @@ -723,12 +723,12 @@ func resourceAciEndpointSecurityGroupRead(ctx context.Context, d *schema.Resourc fvESg, err := getRemoteEndpointSecurityGroup(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setEndpointSecurityGroupAttributes(fvESg, d) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } fvRsConsData, err := aciClient.ReadRelationfvRsCons(dn) diff --git a/aci/resource_aci_fvrsconsif.go b/aci/resource_aci_fvrsconsif.go index 3ddce413d..f50b74a7c 100644 --- a/aci/resource_aci_fvrsconsif.go +++ b/aci/resource_aci_fvrsconsif.go @@ -174,7 +174,7 @@ func resourceAciContractInterfaceRelationshipRead(ctx context.Context, d *schema fvRsConsIf, err := getRemoteContractInterfaceRelationship(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setContractInterfaceRelationshipAttributes(fvRsConsIf, d) diff --git a/aci/resource_aci_fvrsctxtobgpctxafpol.go b/aci/resource_aci_fvrsctxtobgpctxafpol.go index 9f78dce82..34acc4f8e 100644 --- a/aci/resource_aci_fvrsctxtobgpctxafpol.go +++ b/aci/resource_aci_fvrsctxtobgpctxafpol.go @@ -164,7 +164,7 @@ func resourceAciBGPAddressFamilyContextPolicyRelationshipRead(ctx context.Contex fvRsCtxToBgpCtxAfPol, err := getRemoteBGPAddressFamilyContextPolicyRelationship(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setBGPAddressFamilyContextPolicyRelationshipAttributes(fvRsCtxToBgpCtxAfPol, d) diff --git a/aci/resource_aci_fvtagselector.go b/aci/resource_aci_fvtagselector.go index 843e35a1f..6f65ece97 100644 --- a/aci/resource_aci_fvtagselector.go +++ b/aci/resource_aci_fvtagselector.go @@ -203,12 +203,12 @@ func resourceAciEndpointSecurityGroupTagSelectorRead(ctx context.Context, d *sch fvTagSelector, err := getRemoteEndpointSecurityGroupTagSelector(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setEndpointSecurityGroupTagSelectorAttributes(fvTagSelector, d) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } log.Printf("[DEBUG] %s: Read finished successfully", d.Id()) diff --git a/aci/resource_aci_infraaccnodepgrp.go b/aci/resource_aci_infraaccnodepgrp.go index acf664bad..c71a7a53d 100644 --- a/aci/resource_aci_infraaccnodepgrp.go +++ b/aci/resource_aci_infraaccnodepgrp.go @@ -844,7 +844,7 @@ func resourceAciAccessSwitchPolicyGroupRead(ctx context.Context, d *schema.Resou infraAccNodePGrp, err := getRemoteAccessSwitchPolicyGroup(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } setAccessSwitchPolicyGroupAttributes(infraAccNodePGrp, d) diff --git a/aci/resource_aci_infraporttrackpol.go b/aci/resource_aci_infraporttrackpol.go index f26c5fe61..866178e44 100644 --- a/aci/resource_aci_infraporttrackpol.go +++ b/aci/resource_aci_infraporttrackpol.go @@ -202,7 +202,7 @@ func resourceAciPortTrackingRead(ctx context.Context, d *schema.ResourceData, m infraPortTrackPol, err := getRemotePortTracking(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setPortTrackingAttributes(infraPortTrackPol, d) if err != nil { diff --git a/aci/resource_aci_infrarsdomp.go b/aci/resource_aci_infrarsdomp.go index 4acb9fc40..abee5bb8f 100644 --- a/aci/resource_aci_infrarsdomp.go +++ b/aci/resource_aci_infrarsdomp.go @@ -154,7 +154,7 @@ func resourceAciInfraRsDomPRead(ctx context.Context, d *schema.ResourceData, m i infraRsDomP, err := getRemoteInfraRsDomP(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setInfraRsDomPAttributes(infraRsDomP, d) diff --git a/aci/resource_aci_infrasetpol.go b/aci/resource_aci_infrasetpol.go index 370a6d3bd..ca3ae370f 100644 --- a/aci/resource_aci_infrasetpol.go +++ b/aci/resource_aci_infrasetpol.go @@ -307,7 +307,7 @@ func resourceAciFabricWideSettingsPolicyRead(ctx context.Context, d *schema.Reso infraSetPol, err := getRemoteFabricWideSettingsPolicy(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setFabricWideSettingsPolicyAttributes(infraSetPol, d) if err != nil { diff --git a/aci/resource_aci_infrashports.go b/aci/resource_aci_infrashports.go index d8ff476f3..adae3955b 100644 --- a/aci/resource_aci_infrashports.go +++ b/aci/resource_aci_infrashports.go @@ -256,7 +256,7 @@ func resourceAciSpineAccessPortSelectorRead(ctx context.Context, d *schema.Resou infraSHPortS, err := getRemoteSpineAccessPortSelector(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setSpineAccessPortSelectorAttributes(infraSHPortS, d) diff --git a/aci/resource_aci_infraspineaccnodepgrp.go b/aci/resource_aci_infraspineaccnodepgrp.go index 0128eefe3..3e4c76d4d 100644 --- a/aci/resource_aci_infraspineaccnodepgrp.go +++ b/aci/resource_aci_infraspineaccnodepgrp.go @@ -387,7 +387,7 @@ func resourceAciSpineSwitchPolicyGroupRead(ctx context.Context, d *schema.Resour infraSpineAccNodePGrp, err := getRemoteSpineSwitchPolicyGroup(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } setSpineSwitchPolicyGroupAttributes(infraSpineAccNodePGrp, d) diff --git a/aci/resource_aci_isisdompol.go b/aci/resource_aci_isisdompol.go index a8eda6e0b..4604fa872 100644 --- a/aci/resource_aci_isisdompol.go +++ b/aci/resource_aci_isisdompol.go @@ -342,7 +342,7 @@ func resourceAciISISDomainPolicyRead(ctx context.Context, d *schema.ResourceData isisDomPol, err := getRemoteISISDomainPolicy(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setISISDomainPolicyAttributes(isisDomPol, d) if err != nil { diff --git a/aci/resource_aci_mcpinstpol.go b/aci/resource_aci_mcpinstpol.go index fe9762a5a..439c97dea 100644 --- a/aci/resource_aci_mcpinstpol.go +++ b/aci/resource_aci_mcpinstpol.go @@ -313,7 +313,7 @@ func resourceAciMiscablingProtocolInstancePolicyRead(ctx context.Context, d *sch mcpInstPol, err := getRemoteMiscablingProtocolInstancePolicy(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setMiscablingProtocolInstancePolicyAttributes(mcpInstPol, d) if err != nil { diff --git a/aci/resource_aci_mgmtconnectivityprefs.go b/aci/resource_aci_mgmtconnectivityprefs.go index 31bba8ca4..c46cd11a9 100644 --- a/aci/resource_aci_mgmtconnectivityprefs.go +++ b/aci/resource_aci_mgmtconnectivityprefs.go @@ -154,7 +154,7 @@ func resourceAciMgmtconnectivitypreferenceRead(ctx context.Context, d *schema.Re mgmtConnectivityPrefs, err := getRemoteMgmtconnectivitypreference(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setMgmtconnectivitypreferenceAttributes(mgmtConnectivityPrefs, d) if err != nil { diff --git a/aci/resource_aci_mgmtgrp.go b/aci/resource_aci_mgmtgrp.go index c54d4d7b9..e414912e3 100644 --- a/aci/resource_aci_mgmtgrp.go +++ b/aci/resource_aci_mgmtgrp.go @@ -141,7 +141,7 @@ func resourceAciManagedNodeConnectivityGroupRead(ctx context.Context, d *schema. mgmtGrp, err := getRemoteManagedNodeConnectivityGroup(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } setManagedNodeConnectivityGroupAttributes(mgmtGrp, d) diff --git a/aci/resource_aci_mgmtinboobzone.go b/aci/resource_aci_mgmtinboobzone.go index d6318d7e1..da36f8a4e 100644 --- a/aci/resource_aci_mgmtinboobzone.go +++ b/aci/resource_aci_mgmtinboobzone.go @@ -597,7 +597,7 @@ func resourceAciInBManagedNodesZoneRead(ctx context.Context, d *schema.ResourceD mgmtInBZone, err := getRemoteInBManagedNodesZone(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setInBManagedNodesZoneAttributes(mgmtInBZone, d) if err != nil { @@ -639,7 +639,7 @@ func resourceAciOOBManagedNodesZoneRead(ctx context.Context, d *schema.ResourceD mgmtOoBZone, err := getRemoteOOBManagedNodesZone(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setOOBManagedNodesZoneAttributes(mgmtOoBZone, d) if err != nil { diff --git a/aci/resource_aci_pkiexportencryptionkey.go b/aci/resource_aci_pkiexportencryptionkey.go index e501ec4a4..ff7652b6f 100644 --- a/aci/resource_aci_pkiexportencryptionkey.go +++ b/aci/resource_aci_pkiexportencryptionkey.go @@ -196,7 +196,7 @@ func resourceAciAESEncryptionPassphraseandKeysforConfigExportImportRead(ctx cont pkiExportEncryptionKey, err := getRemoteAESEncryptionPassphraseandKeysforConfigExportImport(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setAESEncryptionPassphraseandKeysforConfigExportImportAttributes(pkiExportEncryptionKey, d) if err != nil { diff --git a/aci/resource_aci_qosinstpol.go b/aci/resource_aci_qosinstpol.go index 06055ce0d..9efafe544 100644 --- a/aci/resource_aci_qosinstpol.go +++ b/aci/resource_aci_qosinstpol.go @@ -277,7 +277,7 @@ func resourceAciQOSInstancePolicyRead(ctx context.Context, d *schema.ResourceDat qosInstPol, err := getRemoteQOSInstancePolicy(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setQOSInstancePolicyAttributes(qosInstPol, d) if err != nil { diff --git a/aci/resource_aci_rtctrlattrp.go b/aci/resource_aci_rtctrlattrp.go index d10df4369..c7b9a970c 100644 --- a/aci/resource_aci_rtctrlattrp.go +++ b/aci/resource_aci_rtctrlattrp.go @@ -1331,7 +1331,7 @@ func resourceAciActionRuleProfileRead(ctx context.Context, d *schema.ResourceDat if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setActionRuleProfileAttributes(rtctrlAttrP, d) if err != nil { diff --git a/aci/resource_aci_rtctrlctxp.go b/aci/resource_aci_rtctrlctxp.go index ebcc2629f..54889ca1f 100644 --- a/aci/resource_aci_rtctrlctxp.go +++ b/aci/resource_aci_rtctrlctxp.go @@ -336,7 +336,7 @@ func resourceAciRouteControlContextRead(ctx context.Context, d *schema.ResourceD rtctrlCtxP, err := getRemoteRouteControlContext(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setRouteControlContextAttributes(rtctrlCtxP, d) if err != nil { diff --git a/aci/resource_aci_rtctrlmatchcommregexterm.go b/aci/resource_aci_rtctrlmatchcommregexterm.go index 8eff4a249..0b1ad6c10 100644 --- a/aci/resource_aci_rtctrlmatchcommregexterm.go +++ b/aci/resource_aci_rtctrlmatchcommregexterm.go @@ -197,7 +197,7 @@ func resourceAciMatchRuleBasedonCommunityRegularExpressionRead(ctx context.Conte rtctrlMatchCommRegexTerm, err := getRemoteMatchRuleBasedonCommunityRegularExpression(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setMatchRuleBasedonCommunityRegularExpressionAttributes(rtctrlMatchCommRegexTerm, d) diff --git a/aci/resource_aci_rtctrlmatchcommterm.go b/aci/resource_aci_rtctrlmatchcommterm.go index e4dacad02..f57b7263b 100644 --- a/aci/resource_aci_rtctrlmatchcommterm.go +++ b/aci/resource_aci_rtctrlmatchcommterm.go @@ -312,7 +312,7 @@ func resourceAciMatchCommunityTermRead(ctx context.Context, d *schema.ResourceDa rtctrlMatchCommTerm, err := getRemoteMatchCommunityTerm(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setMatchCommunityTermAttributes(rtctrlMatchCommTerm, d) diff --git a/aci/resource_aci_rtctrlmatchrtdest.go b/aci/resource_aci_rtctrlmatchrtdest.go index 56f0cf4bd..5e3b3cba2 100644 --- a/aci/resource_aci_rtctrlmatchrtdest.go +++ b/aci/resource_aci_rtctrlmatchrtdest.go @@ -214,7 +214,7 @@ func resourceAciMatchRouteDestinationRuleRead(ctx context.Context, d *schema.Res rtctrlMatchRtDest, err := getRemoteMatchRouteDestinationRule(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setMatchRouteDestinationRuleAttributes(rtctrlMatchRtDest, d) if err != nil { diff --git a/aci/resource_aci_rtctrlsetaddcomm.go b/aci/resource_aci_rtctrlsetaddcomm.go index 19a80f50a..a7250d134 100644 --- a/aci/resource_aci_rtctrlsetaddcomm.go +++ b/aci/resource_aci_rtctrlsetaddcomm.go @@ -184,7 +184,7 @@ func resourceAciRtctrlSetAddCommRead(ctx context.Context, d *schema.ResourceData rtctrlSetAddComm, err := getRemoteRtctrlSetAddComm(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setRtctrlSetAddCommAttributes(rtctrlSetAddComm, d) diff --git a/aci/resource_aci_rtctrlsubjp.go b/aci/resource_aci_rtctrlsubjp.go index 83d747491..5d1b9ce77 100644 --- a/aci/resource_aci_rtctrlsubjp.go +++ b/aci/resource_aci_rtctrlsubjp.go @@ -153,7 +153,7 @@ func resourceAciMatchRuleRead(ctx context.Context, d *schema.ResourceData, m int rtctrlSubjP, err := getRemoteMatchRule(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setMatchRuleAttributes(rtctrlSubjP, d) if err != nil { diff --git a/aci/resource_aci_snmpcommunityp.go b/aci/resource_aci_snmpcommunityp.go index 134366d4d..ca11c9e70 100644 --- a/aci/resource_aci_snmpcommunityp.go +++ b/aci/resource_aci_snmpcommunityp.go @@ -175,7 +175,7 @@ func resourceAciSNMPCommunityRead(ctx context.Context, d *schema.ResourceData, m snmpCommunityP, err := getRemoteSNMPCommunity(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setSNMPCommunityAttributes(snmpCommunityP, d) diff --git a/aci/resource_aci_snmpcommunityp_deprecated.go b/aci/resource_aci_snmpcommunityp_deprecated.go index 9219579c7..2ea57cc24 100644 --- a/aci/resource_aci_snmpcommunityp_deprecated.go +++ b/aci/resource_aci_snmpcommunityp_deprecated.go @@ -162,7 +162,7 @@ func resourceAciSNMPCommunityReadDeprecated(ctx context.Context, d *schema.Resou snmpCommunityP, err := getRemoteSNMPCommunity(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setSNMPCommunityAttributesDeprecated(snmpCommunityP, d) diff --git a/aci/resource_aci_snmpctxp.go b/aci/resource_aci_snmpctxp.go index 729f6e5aa..dbcb2063e 100644 --- a/aci/resource_aci_snmpctxp.go +++ b/aci/resource_aci_snmpctxp.go @@ -157,7 +157,7 @@ func resourceAciSNMPContextProfileRead(ctx context.Context, d *schema.ResourceDa snmpCtxP, err := getRemoteSNMPContextProfile(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setSNMPContextProfileAttributes(snmpCtxP, d) if err != nil { diff --git a/aci/resource_aci_stpifpol.go b/aci/resource_aci_stpifpol.go index 40bb8c09a..06783f2b0 100644 --- a/aci/resource_aci_stpifpol.go +++ b/aci/resource_aci_stpifpol.go @@ -202,12 +202,12 @@ func resourceAciSpanningTreeInterfacePolicyRead(ctx context.Context, d *schema.R stpIfPol, err := getRemoteSpanningTreeInterfacePolicy(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setSpanningTreeInterfacePolicyAttributes(stpIfPol, d) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } log.Printf("[DEBUG] %s: Read finished successfully", d.Id()) diff --git a/aci/resource_aci_tacacsgroup.go b/aci/resource_aci_tacacsgroup.go index 651fd1f64..d324d5081 100644 --- a/aci/resource_aci_tacacsgroup.go +++ b/aci/resource_aci_tacacsgroup.go @@ -142,7 +142,7 @@ func resourceAciTACACSMonitoringDestinationGroupRead(ctx context.Context, d *sch tacacsGroup, err := getRemoteTACACSMonitoringDestinationGroup(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setTACACSMonitoringDestinationGroupAttributes(tacacsGroup, d) if err != nil { diff --git a/aci/resource_aci_tacacssrc.go b/aci/resource_aci_tacacssrc.go index 5ebddf0c6..ef5cfa8ae 100644 --- a/aci/resource_aci_tacacssrc.go +++ b/aci/resource_aci_tacacssrc.go @@ -298,7 +298,7 @@ func resourceAciTACACSSourceRead(ctx context.Context, d *schema.ResourceData, m tacacsSrc, err := getRemoteTACACSSource(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setTACACSSourceAttributes(tacacsSrc, d) if err != nil { diff --git a/aci/resource_aci_tacacstacacsdest.go b/aci/resource_aci_tacacstacacsdest.go index f7ddb8661..6f8143223 100644 --- a/aci/resource_aci_tacacstacacsdest.go +++ b/aci/resource_aci_tacacstacacsdest.go @@ -315,7 +315,7 @@ func resourceAciTACACSDestinationRead(ctx context.Context, d *schema.ResourceDat tacacsTacacsDest, err := getRemoteTACACSDestination(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setTACACSDestinationAttributes(tacacsTacacsDest, d) if err != nil { diff --git a/aci/resource_aci_tagannotation.go b/aci/resource_aci_tagannotation.go index c6ca2f439..65366357b 100644 --- a/aci/resource_aci_tagannotation.go +++ b/aci/resource_aci_tagannotation.go @@ -144,7 +144,7 @@ func resourceAciAnnotationRead(ctx context.Context, d *schema.ResourceData, m in tagAnnotation, err := getRemoteAnnotation(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setAnnotationAttributes(tagAnnotation, d) if err != nil { diff --git a/aci/resource_aci_tagtag.go b/aci/resource_aci_tagtag.go index e4aa34404..186684b14 100644 --- a/aci/resource_aci_tagtag.go +++ b/aci/resource_aci_tagtag.go @@ -144,7 +144,7 @@ func resourceAciTagRead(ctx context.Context, d *schema.ResourceData, m interface tagTag, err := getRemoteTag(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setTagAttributes(tagTag, d) if err != nil { diff --git a/aci/resource_aci_trigrecurrwindowp.go b/aci/resource_aci_trigrecurrwindowp.go index ec82ec207..e7997c886 100644 --- a/aci/resource_aci_trigrecurrwindowp.go +++ b/aci/resource_aci_trigrecurrwindowp.go @@ -292,7 +292,7 @@ func resourceAciRecurringWindowRead(ctx context.Context, d *schema.ResourceData, trigRecurrWindowP, err := getRemoteRecurringWindow(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } setRecurringWindowAttributes(trigRecurrWindowP, d) diff --git a/aci/resource_aci_vmmctrlrp.go b/aci/resource_aci_vmmctrlrp.go index b8c5bec09..21c156100 100644 --- a/aci/resource_aci_vmmctrlrp.go +++ b/aci/resource_aci_vmmctrlrp.go @@ -833,12 +833,12 @@ func resourceAciVMMControllerRead(ctx context.Context, d *schema.ResourceData, m vmmCtrlrP, err := getRemoteVMMController(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setVMMControllerAttributes(vmmCtrlrP, d) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } vmmRsAccData, err := aciClient.ReadRelationvmmRsAcc(dn) diff --git a/aci/resource_aci_vmmusraccp.go b/aci/resource_aci_vmmusraccp.go index a14dbe681..acca873b3 100644 --- a/aci/resource_aci_vmmusraccp.go +++ b/aci/resource_aci_vmmusraccp.go @@ -181,7 +181,7 @@ func resourceAciVMMCredentialRead(ctx context.Context, d *schema.ResourceData, m vmmUsrAccP, err := getRemoteVMMCredential(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setVMMCredentialAttributes(vmmUsrAccP, d) if err != nil { diff --git a/aci/resource_aci_vmmvswitchpolicycont.go b/aci/resource_aci_vmmvswitchpolicycont.go index ecf5d3dad..ccb7bf65a 100644 --- a/aci/resource_aci_vmmvswitchpolicycont.go +++ b/aci/resource_aci_vmmvswitchpolicycont.go @@ -515,7 +515,7 @@ func resourceAciVSwitchPolicyGroupRead(ctx context.Context, d *schema.ResourceDa vmmVSwitchPolicyCont, err := getRemoteVSwitchPolicyGroup(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } _, err = setVSwitchPolicyGroupAttributes(vmmVSwitchPolicyCont, d) if err != nil { diff --git a/aci/resource_aci_vpcinstpol.go b/aci/resource_aci_vpcinstpol.go index 31dc38512..e4b2137fd 100644 --- a/aci/resource_aci_vpcinstpol.go +++ b/aci/resource_aci_vpcinstpol.go @@ -158,7 +158,7 @@ func resourceAciVPCDomainPolicyRead(ctx context.Context, d *schema.ResourceData, vpcInstPol, err := getRemoteVPCDomainPolicy(aciClient, dn) if err != nil { d.SetId("") - return diag.FromErr(err) + return nil } setVPCDomainPolicyAttributes(vpcInstPol, d)