From e31d87b198f8f74e3bf81bba5137cb9590454456 Mon Sep 17 00:00:00 2001 From: Josh Silvas Date: Wed, 27 Mar 2024 18:07:11 -0500 Subject: [PATCH] Do not return on d.Set() errors. --- VERSION | 2 +- internal/awx/data_source_credential_role.go | 3 +- internal/awx/data_source_inventory_role.go | 3 +- internal/awx/data_source_job_template_role.go | 3 +- internal/awx/data_source_organization_role.go | 3 +- internal/awx/data_source_project_role.go | 3 +- .../awx/resource_execution_environment.go | 10 ++-- internal/awx/resource_host.go | 14 ++--- internal/awx/resource_instance_group.go | 6 +-- internal/awx/resource_inventory.go | 12 ++--- internal/awx/resource_inventory_group.go | 8 +-- internal/awx/resource_inventory_source.go | 42 +++++++-------- internal/awx/resource_job_template.go | 54 +++++++++---------- .../awx/resource_notification_template.go | 10 ++-- internal/awx/resource_organization.go | 8 +-- internal/awx/resource_project.go | 24 ++++----- internal/awx/resource_schedule.go | 14 ++--- internal/awx/resource_team.go | 8 +-- .../awx/resource_workflow_job_template.go | 30 +++++------ .../resource_workflow_job_template_node.go | 26 ++++----- 20 files changed, 144 insertions(+), 139 deletions(-) diff --git a/VERSION b/VERSION index 0ec25f75..b18d4654 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v1.0.0 +v1.0.1 diff --git a/internal/awx/data_source_credential_role.go b/internal/awx/data_source_credential_role.go index 6d1f0c51..d40a2776 100644 --- a/internal/awx/data_source_credential_role.go +++ b/internal/awx/data_source_credential_role.go @@ -2,6 +2,7 @@ package awx import ( "context" + "fmt" "strconv" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -88,7 +89,7 @@ func dataSourceCredentialMachineRoleRead(ctx context.Context, d *schema.Resource func setCredentialRoleData(d *schema.ResourceData, r *awx.ApplyRole) *schema.ResourceData { if err := d.Set("name", r.Name); err != nil { - return d + fmt.Println("Error setting name", err) } d.SetId(strconv.Itoa(r.ID)) return d diff --git a/internal/awx/data_source_inventory_role.go b/internal/awx/data_source_inventory_role.go index 8decd77b..c88965ac 100644 --- a/internal/awx/data_source_inventory_role.go +++ b/internal/awx/data_source_inventory_role.go @@ -2,6 +2,7 @@ package awx import ( "context" + "fmt" "strconv" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -88,7 +89,7 @@ func dataSourceInventoryRoleRead(ctx context.Context, d *schema.ResourceData, m func setInventoryRoleData(d *schema.ResourceData, r *awx.ApplyRole) *schema.ResourceData { if err := d.Set("name", r.Name); err != nil { - return d + fmt.Println("Error setting name", err) } d.SetId(strconv.Itoa(r.ID)) return d diff --git a/internal/awx/data_source_job_template_role.go b/internal/awx/data_source_job_template_role.go index 1e206b89..c1397edc 100644 --- a/internal/awx/data_source_job_template_role.go +++ b/internal/awx/data_source_job_template_role.go @@ -2,6 +2,7 @@ package awx import ( "context" + "fmt" "strconv" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -88,7 +89,7 @@ func dataSourceJobTemplateRoleRead(ctx context.Context, d *schema.ResourceData, func setJobTemplateRoleData(d *schema.ResourceData, r *awx.ApplyRole) *schema.ResourceData { if err := d.Set("name", r.Name); err != nil { - return d + fmt.Println("Error setting name", err) } d.SetId(strconv.Itoa(r.ID)) return d diff --git a/internal/awx/data_source_organization_role.go b/internal/awx/data_source_organization_role.go index de3b8cb7..84e7d309 100644 --- a/internal/awx/data_source_organization_role.go +++ b/internal/awx/data_source_organization_role.go @@ -2,6 +2,7 @@ package awx import ( "context" + "fmt" "strconv" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -98,7 +99,7 @@ func dataSourceOrganizationRolesRead(ctx context.Context, d *schema.ResourceData func setOrganizationRoleData(d *schema.ResourceData, r *awx.ApplyRole) *schema.ResourceData { if err := d.Set("name", r.Name); err != nil { - return d + fmt.Println("Error setting name", err) } d.SetId(strconv.Itoa(r.ID)) return d diff --git a/internal/awx/data_source_project_role.go b/internal/awx/data_source_project_role.go index 46cb9ecc..7383f34d 100644 --- a/internal/awx/data_source_project_role.go +++ b/internal/awx/data_source_project_role.go @@ -2,6 +2,7 @@ package awx import ( "context" + "fmt" "strconv" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -87,7 +88,7 @@ func dataSourceProjectRolesRead(ctx context.Context, d *schema.ResourceData, m i func setProjectRoleData(d *schema.ResourceData, r *awx.ApplyRole) *schema.ResourceData { if err := d.Set("name", r.Name); err != nil { - return d + fmt.Println("Error setting name", err) } d.SetId(strconv.Itoa(r.ID)) return d diff --git a/internal/awx/resource_execution_environment.go b/internal/awx/resource_execution_environment.go index a44f40af..5a6b6d52 100644 --- a/internal/awx/resource_execution_environment.go +++ b/internal/awx/resource_execution_environment.go @@ -152,19 +152,19 @@ func resourceExecutionEnvironmentsDelete(ctx context.Context, d *schema.Resource func setExecutionEnvironmentsResourceData(d *schema.ResourceData, r *awx.ExecutionEnvironment) *schema.ResourceData { if err := d.Set("name", r.Name); err != nil { - return d + fmt.Println("Error setting name", err) } if err := d.Set("image", r.Image); err != nil { - return d + fmt.Println("Error setting image", err) } if err := d.Set("description", r.Description); err != nil { - return d + fmt.Println("Error setting description", err) } if err := d.Set("organization", r.Organization); err != nil { - return d + fmt.Println("Error setting organization", err) } if err := d.Set("credential", r.Credential); err != nil { - return d + fmt.Println("Error setting credential", err) } d.SetId(strconv.Itoa(r.ID)) return d diff --git a/internal/awx/resource_host.go b/internal/awx/resource_host.go index 84d2cf97..261d8c1d 100644 --- a/internal/awx/resource_host.go +++ b/internal/awx/resource_host.go @@ -180,25 +180,25 @@ func resourceHostDelete(ctx context.Context, d *schema.ResourceData, m interface func setHostResourceData(d *schema.ResourceData, r *awx.Host) *schema.ResourceData { if err := d.Set("name", r.Name); err != nil { - return d + fmt.Println("Error setting name", err) } if err := d.Set("description", r.Description); err != nil { - return d + fmt.Println("Error setting description", err) } if err := d.Set("inventory_id", r.Inventory); err != nil { - return d + fmt.Println("Error setting inventory_id", err) } if err := d.Set("enabled", r.Enabled); err != nil { - return d + fmt.Println("Error setting enabled", err) } if err := d.Set("instance_id", r.InstanceID); err != nil { - return d + fmt.Println("Error setting instance_id", err) } if err := d.Set("variables", normalizeJsonYaml(r.Variables)); err != nil { - return d + fmt.Println("Error setting variables", err) } if err := d.Set("group_ids", d.Get("group_ids").([]interface{})); err != nil { - return d + fmt.Println("Error setting group_ids", err) } return d } diff --git a/internal/awx/resource_instance_group.go b/internal/awx/resource_instance_group.go index a20eb4ce..f52d8a99 100644 --- a/internal/awx/resource_instance_group.go +++ b/internal/awx/resource_instance_group.go @@ -139,13 +139,13 @@ func resourceInstanceGroupRead(ctx context.Context, d *schema.ResourceData, m in func setInstanceGroupResourceData(d *schema.ResourceData, r *awx.InstanceGroup) *schema.ResourceData { if err := d.Set("name", r.Name); err != nil { - return d + fmt.Println("Error setting name", err) } if err := d.Set("is_container_group", r.IsContainerGroup); err != nil { - return d + fmt.Println("Error setting is_container_group", err) } if err := d.Set("pod_spec_override", normalizeJsonYaml(r.PodSpecOverride)); err != nil { - return d + fmt.Println("Error setting pod_spec_override", err) } d.SetId(strconv.Itoa(r.ID)) diff --git a/internal/awx/resource_inventory.go b/internal/awx/resource_inventory.go index 57860dcd..68457491 100644 --- a/internal/awx/resource_inventory.go +++ b/internal/awx/resource_inventory.go @@ -143,22 +143,22 @@ func resourceInventoryDelete(ctx context.Context, d *schema.ResourceData, m inte func setInventoryResourceData(d *schema.ResourceData, r *awx.Inventory) *schema.ResourceData { if err := d.Set("name", r.Name); err != nil { - return d + fmt.Println("Error setting name", err) } if err := d.Set("organization_id", strconv.Itoa(r.Organization)); err != nil { - return d + fmt.Println("Error setting organization_id", err) } if err := d.Set("description", r.Description); err != nil { - return d + fmt.Println("Error setting description", err) } if err := d.Set("kind", r.Kind); err != nil { - return d + fmt.Println("Error setting kind", err) } if err := d.Set("host_filter", r.HostFilter); err != nil { - return d + fmt.Println("Error setting host_filter", err) } if err := d.Set("variables", normalizeJsonYaml(r.Variables)); err != nil { - return d + fmt.Println("Error setting variables", err) } d.SetId(strconv.Itoa(r.ID)) return d diff --git a/internal/awx/resource_inventory_group.go b/internal/awx/resource_inventory_group.go index c0d630f5..491a3770 100644 --- a/internal/awx/resource_inventory_group.go +++ b/internal/awx/resource_inventory_group.go @@ -131,16 +131,16 @@ func resourceInventoryGroupRead(ctx context.Context, d *schema.ResourceData, m i func setInventoryGroupResourceData(d *schema.ResourceData, r *awx.Group) *schema.ResourceData { if err := d.Set("name", r.Name); err != nil { - return d + fmt.Println("Error setting name", err) } if err := d.Set("description", r.Description); err != nil { - return d + fmt.Println("Error setting description", err) } if err := d.Set("inventory_id", r.Inventory); err != nil { - return d + fmt.Println("Error setting inventory_id", err) } if err := d.Set("variables", normalizeJsonYaml(r.Variables)); err != nil { - return d + fmt.Println("Error setting variables", err) } d.SetId(strconv.Itoa(r.ID)) diff --git a/internal/awx/resource_inventory_source.go b/internal/awx/resource_inventory_source.go index eceb24fd..19f94551 100644 --- a/internal/awx/resource_inventory_source.go +++ b/internal/awx/resource_inventory_source.go @@ -251,69 +251,69 @@ func resourceInventorySourceRead(ctx context.Context, d *schema.ResourceData, m func setInventorySourceResourceData(d *schema.ResourceData, r *awx.InventorySource) *schema.ResourceData { if err := d.Set("name", r.Name); err != nil { - return d + fmt.Println("Error setting name", err) } if err := d.Set("description", r.Description); err != nil { - return d + fmt.Println("Error setting description", err) } if err := d.Set("enabled_var", r.EnabledVar); err != nil { - return d + fmt.Println("Error setting enabled_var", err) } if err := d.Set("enabled_value", r.EnabledValue); err != nil { - return d + fmt.Println("Error setting enabled_value", err) } if err := d.Set("overwrite", r.Overwrite); err != nil { - return d + fmt.Println("Error setting overwrite", err) } if err := d.Set("overwrite_vars", r.OverwriteVars); err != nil { - return d + fmt.Println("Error setting overwrite_vars", err) } if err := d.Set("update_on_launch", r.UpdateOnLaunch); err != nil { - return d + fmt.Println("Error setting update_on_launch", err) } if err := d.Set("inventory_id", r.Inventory); err != nil { - return d + fmt.Println("Error setting inventory_id", err) } if err := d.Set("credential_id", r.Credential); err != nil { - return d + fmt.Println("Error setting credential_id", err) } if err := d.Set("source", r.Source); err != nil { - return d + fmt.Println("Error setting source", err) } if err := d.Set("source_vars", normalizeJsonYaml(r.SourceVars)); err != nil { - return d + fmt.Println("Error setting source_vars", err) } if err := d.Set("host_filter", r.HostFilter); err != nil { - return d + fmt.Println("Error setting host_filter", err) } if err := d.Set("update_cache_timeout", r.UpdateCacheTimeout); err != nil { - return d + fmt.Println("Error setting update_cache_timeout", err) } if err := d.Set("verbosity", r.Verbosity); err != nil { - return d + fmt.Println("Error setting verbosity", err) } if err := d.Set("source_project_id", r.SourceProject); err != nil { - return d + fmt.Println("Error setting source_project_id", err) } if err := d.Set("source_path", r.SourcePath); err != nil { - return d + fmt.Println("Error setting source_path", err) } // obsolete schema added so terraform doesn't break // these don't do anything in later versions of AWX! Update your code. if err := d.Set("source_regions", r.SourceRegions); err != nil { - return d + fmt.Println("Error setting source_regions", err) } if err := d.Set("instance_filters", r.InstanceFilters); err != nil { - return d + fmt.Println("Error setting instance_filters", err) } if err := d.Set("group_by", r.GroupBy); err != nil { - return d + fmt.Println("Error setting group_by", err) } if err := d.Set("source_project_id", r.SourceProject); err != nil { - return d + fmt.Println("Error setting source_project_id", err) } if err := d.Set("source_path", r.SourcePath); err != nil { - return d + fmt.Println("Error setting source_path", err) } return d diff --git a/internal/awx/resource_job_template.go b/internal/awx/resource_job_template.go index 78065913..4c2fdba4 100644 --- a/internal/awx/resource_job_template.go +++ b/internal/awx/resource_job_template.go @@ -335,85 +335,85 @@ func resourceJobTemplateRead(ctx context.Context, d *schema.ResourceData, m inte func setJobTemplateResourceData(d *schema.ResourceData, r *awx.JobTemplate) *schema.ResourceData { if err := d.Set("allow_simultaneous", r.AllowSimultaneous); err != nil { - return d + fmt.Println("Error setting allow_simultaneous", err) } if err := d.Set("ask_credential_on_launch", r.AskCredentialOnLaunch); err != nil { - return d + fmt.Println("Error setting ask_credential_on_launch", err) } if err := d.Set("ask_job_type_on_launch", r.AskJobTypeOnLaunch); err != nil { - return d + fmt.Println("Error setting ask_job_type_on_launch", err) } if err := d.Set("ask_limit_on_launch", r.AskLimitOnLaunch); err != nil { - return d + fmt.Println("Error setting ask_limit_on_launch", err) } if err := d.Set("ask_skip_tags_on_launch", r.AskSkipTagsOnLaunch); err != nil { - return d + fmt.Println("Error setting ask_skip_tags_on_launch", err) } if err := d.Set("ask_tags_on_launch", r.AskTagsOnLaunch); err != nil { - return d + fmt.Println("Error setting ask_tags_on_launch", err) } if err := d.Set("ask_variables_on_launch", r.AskVariablesOnLaunch); err != nil { - return d + fmt.Println("Error setting ask_variables_on_launch", err) } if err := d.Set("description", r.Description); err != nil { - return d + fmt.Println("Error setting description", err) } if err := d.Set("extra_vars", normalizeJsonYaml(r.ExtraVars)); err != nil { - return d + fmt.Println("Error setting extra_vars", err) } if err := d.Set("force_handlers", r.ForceHandlers); err != nil { - return d + fmt.Println("Error setting force_handlers", err) } if err := d.Set("forks", r.Forks); err != nil { - return d + fmt.Println("Error setting forks", err) } if err := d.Set("host_config_key", r.HostConfigKey); err != nil { - return d + fmt.Println("Error setting host_config_key", err) } if err := d.Set("inventory_id", r.Inventory); err != nil { - return d + fmt.Println("Error setting inventory_id", err) } if err := d.Set("job_tags", r.JobTags); err != nil { - return d + fmt.Println("Error setting job_tags", err) } if err := d.Set("job_type", r.JobType); err != nil { - return d + fmt.Println("Error setting job_type", err) } if err := d.Set("diff_mode", r.DiffMode); err != nil { - return d + fmt.Println("Error setting diff_mode", err) } if err := d.Set("custom_virtualenv", r.CustomVirtualenv); err != nil { - return d + fmt.Println("Error setting custom_virtualenv", err) } if err := d.Set("limit", r.Limit); err != nil { - return d + fmt.Println("Error setting limit", err) } if err := d.Set("name", r.Name); err != nil { - return d + fmt.Println("Error setting name", err) } if err := d.Set("become_enabled", r.BecomeEnabled); err != nil { - return d + fmt.Println("Error setting become_enabled", err) } if err := d.Set("use_fact_cache", r.UseFactCache); err != nil { - return d + fmt.Println("Error setting use_fact_cache", err) } if err := d.Set("playbook", r.Playbook); err != nil { - return d + fmt.Println("Error setting playbook", err) } if err := d.Set("project_id", r.Project); err != nil { - return d + fmt.Println("Error setting project_id", err) } if err := d.Set("skip_tags", r.SkipTags); err != nil { - return d + fmt.Println("Error setting skip_tags", err) } if err := d.Set("start_at_task", r.StartAtTask); err != nil { - return d + fmt.Println("Error setting start_at_task", err) } if err := d.Set("survey_enabled", r.SurveyEnabled); err != nil { - return d + fmt.Println("Error setting survey_enabled", err) } if err := d.Set("verbosity", r.Verbosity); err != nil { - return d + fmt.Println("Error setting verbosity", err) } d.SetId(strconv.Itoa(r.ID)) return d diff --git a/internal/awx/resource_notification_template.go b/internal/awx/resource_notification_template.go index 29ead5c1..6d77d041 100644 --- a/internal/awx/resource_notification_template.go +++ b/internal/awx/resource_notification_template.go @@ -173,19 +173,19 @@ func resourceNotificationTemplateDelete(ctx context.Context, d *schema.ResourceD func setNotificationTemplateResourceData(d *schema.ResourceData, r *awx.NotificationTemplate) *schema.ResourceData { if err := d.Set("name", r.Name); err != nil { - return d + fmt.Println("Error setting name", err) } if err := d.Set("description", r.Description); err != nil { - return d + fmt.Println("Error setting description", err) } if err := d.Set("organization", r.Organization); err != nil { - return d + fmt.Println("Error setting organization", err) } if err := d.Set("notification_type", r.NotificationType); err != nil { - return d + fmt.Println("Error setting notification_type", err) } if err := d.Set("notification_configuration", r.NotificationConfiguration); err != nil { - return d + fmt.Println("Error setting notification_configuration", err) } d.SetId(strconv.Itoa(r.ID)) return d diff --git a/internal/awx/resource_organization.go b/internal/awx/resource_organization.go index 94c08221..07a3111a 100644 --- a/internal/awx/resource_organization.go +++ b/internal/awx/resource_organization.go @@ -159,16 +159,16 @@ func resourceOrganizationsDelete(ctx context.Context, d *schema.ResourceData, m func setOrganizationsResourceData(d *schema.ResourceData, r *awx.Organization) *schema.ResourceData { if err := d.Set("name", r.Name); err != nil { - return d + fmt.Println("Error setting name", err) } if err := d.Set("description", r.Description); err != nil { - return d + fmt.Println("Error setting description", err) } if err := d.Set("max_hosts", r.MaxHosts); err != nil { - return d + fmt.Println("Error setting max_hosts", err) } if err := d.Set("custom_virtualenv", r.CustomVirtualenv); err != nil { - return d + fmt.Println("Error setting custom_virtualenv", err) } d.SetId(strconv.Itoa(r.ID)) return d diff --git a/internal/awx/resource_project.go b/internal/awx/resource_project.go index 7c1038e6..5bc42b56 100644 --- a/internal/awx/resource_project.go +++ b/internal/awx/resource_project.go @@ -260,43 +260,43 @@ func resourceProjectDelete(ctx context.Context, d *schema.ResourceData, m interf func setProjectResourceData(d *schema.ResourceData, r *awx.Project) *schema.ResourceData { if err := d.Set("name", r.Name); err != nil { - return d + fmt.Println("Error setting name", err) } if err := d.Set("description", r.Description); err != nil { - return d + fmt.Println("Error setting description", err) } if err := d.Set("scm_type", r.ScmType); err != nil { - return d + fmt.Println("Error setting scm_type", err) } if err := d.Set("scm_url", r.ScmURL); err != nil { - return d + fmt.Println("Error setting scm_url", err) } if err := d.Set("scm_branch", r.ScmBranch); err != nil { - return d + fmt.Println("Error setting scm_branch", err) } if err := d.Set("scm_clean", r.ScmClean); err != nil { - return d + fmt.Println("Error setting scm_clean", err) } if err := d.Set("scm_delete_on_update", r.ScmDeleteOnUpdate); err != nil { - return d + fmt.Println("Error setting scm_delete_on_update", err) } if err := d.Set("organization_id", r.Organization); err != nil { - return d + fmt.Println("Error setting organization_id", err) } if id, err := strconv.Atoi(r.Credential); err == nil { if err := d.Set("scm_credential_id", id); err != nil { - return d + fmt.Println("Error setting scm_credential_id", err) } } if err := d.Set("scm_update_on_launch", r.ScmUpdateOnLaunch); err != nil { - return d + fmt.Println("Error setting scm_update_on_launch", err) } if err := d.Set("scm_update_cache_timeout", r.ScmUpdateCacheTimeout); err != nil { - return d + fmt.Println("Error setting scm_update_cache_timeout", err) } if err := d.Set("allow_override", r.AllowOverride); err != nil { - return d + fmt.Println("Error setting allow_override", err) } d.SetId(strconv.Itoa(r.ID)) diff --git a/internal/awx/resource_schedule.go b/internal/awx/resource_schedule.go index 37397a20..131644f5 100644 --- a/internal/awx/resource_schedule.go +++ b/internal/awx/resource_schedule.go @@ -174,25 +174,25 @@ func resourceScheduleDelete(ctx context.Context, d *schema.ResourceData, m inter func setScheduleResourceData(d *schema.ResourceData, r *awx.Schedule) *schema.ResourceData { if err := d.Set("name", r.Name); err != nil { - return d + fmt.Println("Error setting name", err) } if err := d.Set("rrule", r.Rrule); err != nil { - return d + fmt.Println("Error setting rrule", err) } if err := d.Set("unified_job_template_id", r.UnifiedJobTemplate); err != nil { - return d + fmt.Println("Error setting unified_job_template_id", err) } if err := d.Set("description", r.Description); err != nil { - return d + fmt.Println("Error setting description", err) } if err := d.Set("enabled", r.Enabled); err != nil { - return d + fmt.Println("Error setting enabled", err) } if err := d.Set("inventory", r.Inventory); err != nil { - return d + fmt.Println("Error setting inventory", err) } if err := d.Set("extra_data", marshalYaml(r.ExtraData)); err != nil { - return d + fmt.Println("Error setting extra_data", err) } d.SetId(strconv.Itoa(r.ID)) return d diff --git a/internal/awx/resource_team.go b/internal/awx/resource_team.go index 85d02d10..af308aac 100644 --- a/internal/awx/resource_team.go +++ b/internal/awx/resource_team.go @@ -219,13 +219,13 @@ func resourceTeamDelete(ctx context.Context, d *schema.ResourceData, m interface func setTeamResourceData(d *schema.ResourceData, r *awx.Team, e []*awx.ApplyRole) *schema.ResourceData { if err := d.Set("name", r.Name); err != nil { - return d + fmt.Println("Error setting name", err) } if err := d.Set("description", r.Description); err != nil { - return d + fmt.Println("Error setting description", err) } if err := d.Set("organization_id", r.Organization); err != nil { - return d + fmt.Println("Error setting organization_id", err) } var entlist []interface{} @@ -242,7 +242,7 @@ func setTeamResourceData(d *schema.ResourceData, r *awx.Team, e []*awx.ApplyRole ent := schema.NewSet(f, entlist) if err := d.Set("role_entitlement", ent); err != nil { - return d + fmt.Println("Error setting role_entitlement", err) } d.SetId(strconv.Itoa(r.ID)) diff --git a/internal/awx/resource_workflow_job_template.go b/internal/awx/resource_workflow_job_template.go index 2973b014..59049221 100644 --- a/internal/awx/resource_workflow_job_template.go +++ b/internal/awx/resource_workflow_job_template.go @@ -224,49 +224,49 @@ func resourceWorkflowJobTemplateDelete(ctx context.Context, d *schema.ResourceDa func setWorkflowJobTemplateResourceData(d *schema.ResourceData, r *awx.WorkflowJobTemplate) *schema.ResourceData { if err := d.Set("name", r.Name); err != nil { - return d + fmt.Println("Error setting name", err) } if err := d.Set("description", r.Description); err != nil { - return d + fmt.Println("Error setting description", err) } if err := d.Set("organization_id", strconv.Itoa(r.Organization)); err != nil { - return d + fmt.Println("Error setting organization_id", err) } if err := d.Set("inventory_id", strconv.Itoa(r.Inventory)); err != nil { - return d + fmt.Println("Error setting inventory_id", err) } if err := d.Set("survey_enabled", r.SurveyEnabled); err != nil { - return d + fmt.Println("Error setting survey_enabled", err) } if err := d.Set("allow_simultaneous", r.AllowSimultaneous); err != nil { - return d + fmt.Println("Error setting allow_simultaneous", err) } if err := d.Set("ask_variables_on_launch", r.AskVariablesOnLaunch); err != nil { - return d + fmt.Println("Error setting ask_variables_on_launch", err) } if err := d.Set("limit", r.Limit); err != nil { - return d + fmt.Println("Error setting limit", err) } if err := d.Set("scm_branch", r.ScmBranch); err != nil { - return d + fmt.Println("Error setting scm_branch", err) } if err := d.Set("ask_inventory_on_launch", r.AskInventoryOnLaunch); err != nil { - return d + fmt.Println("Error setting ask_inventory_on_launch", err) } if err := d.Set("ask_scm_branch_on_launch", r.AskScmBranchOnLaunch); err != nil { - return d + fmt.Println("Error setting ask_scm_branch_on_launch", err) } if err := d.Set("ask_limit_on_launch", r.AskLimitOnLaunch); err != nil { - return d + fmt.Println("Error setting ask_limit_on_launch", err) } if err := d.Set("webhook_service", r.WebhookService); err != nil { - return d + fmt.Println("Error setting webhook_service", err) } if err := d.Set("webhook_credential", r.WebhookCredential); err != nil { - return d + fmt.Println("Error setting webhook_credential", err) } if err := d.Set("variables", normalizeJsonYaml(r.ExtraVars)); err != nil { - return d + fmt.Println("Error setting variables", err) } d.SetId(strconv.Itoa(r.ID)) diff --git a/internal/awx/resource_workflow_job_template_node.go b/internal/awx/resource_workflow_job_template_node.go index 39f2b928..6412e623 100644 --- a/internal/awx/resource_workflow_job_template_node.go +++ b/internal/awx/resource_workflow_job_template_node.go @@ -248,44 +248,44 @@ func resourceWorkflowJobTemplateNodeDelete(ctx context.Context, d *schema.Resour func setWorkflowJobTemplateNodeResourceData(d *schema.ResourceData, r *awx.WorkflowJobTemplateNode) *schema.ResourceData { if err := d.Set("extra_data", normalizeJsonYaml(r.ExtraData)); err != nil { - return d + fmt.Println("Error setting extra_data", err) } if err := d.Set("inventory_id", strconv.Itoa(r.Inventory)); err != nil { - return d + fmt.Println("Error setting inventory_id", err) } if err := d.Set("scm_branch", r.ScmBranch); err != nil { - return d + fmt.Println("Error setting scm_branch", err) } if err := d.Set("job_type", r.JobType); err != nil { - return d + fmt.Println("Error setting job_type", err) } if err := d.Set("job_tags", r.JobTags); err != nil { - return d + fmt.Println("Error setting job_tags", err) } if err := d.Set("skip_tags", r.SkipTags); err != nil { - return d + fmt.Println("Error setting skip_tags", err) } if err := d.Set("limit", r.Limit); err != nil { - return d + fmt.Println("Error setting limit", err) } if err := d.Set("diff_mode", r.DiffMode); err != nil { - return d + fmt.Println("Error setting diff_mode", err) } if err := d.Set("verbosity", r.Verbosity); err != nil { - return d + fmt.Println("Error setting verbosity", err) } if err := d.Set("workflow_job_template_id", strconv.Itoa(r.WorkflowJobTemplate)); err != nil { - return d + fmt.Println("Error setting workflow_job_template_id", err) } if err := d.Set("unified_job_template_id", strconv.Itoa(r.UnifiedJobTemplate)); err != nil { - return d + fmt.Println("Error setting unified_job_template_id", err) } if err := d.Set("all_parents_must_converge", r.AllParentsMustConverge); err != nil { - return d + fmt.Println("Error setting all_parents_must_converge", err) } if err := d.Set("identifier", r.Identifier); err != nil { - return d + fmt.Println("Error setting identifier", err) } d.SetId(strconv.Itoa(r.ID))