Skip to content

Commit 98fc16e

Browse files
Only refresh project name if Rundeck server provides it.
It seems that not all Rundeck servers consistently return the project name when retrieving a job. Not yet sure in what situations it is or isn't returned, but since jobs are not allowed to move between projects anyway it doesn't hurt to just skip refreshing it if the server provides no value.
1 parent 86882e3 commit 98fc16e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

builtin/providers/rundeck/resource_job.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,14 @@ func jobToResourceData(job *rundeck.JobDetail, d *schema.ResourceData) error {
463463
d.Set("id", job.ID)
464464
d.Set("name", job.Name)
465465
d.Set("group_name", job.GroupName)
466-
d.Set("project_name", job.ProjectName)
466+
467+
// The project name is not consistently returned in all rundeck versions,
468+
// so we'll only update it if it's set. Jobs can't move between projects
469+
// anyway, so this is harmless.
470+
if job.ProjectName != "" {
471+
d.Set("project_name", job.ProjectName)
472+
}
473+
467474
d.Set("description", job.Description)
468475
d.Set("log_level", job.LogLevel)
469476
d.Set("allow_concurrent_executions", job.AllowConcurrentExecutions)

0 commit comments

Comments
 (0)