Skip to content

Commit

Permalink
Merge pull request #4301 from apparentlymart/rundeck-task-project-issue
Browse files Browse the repository at this point in the history
Only refresh project name if Rundeck server provides it
  • Loading branch information
apparentlymart committed Dec 18, 2015
2 parents 3adda82 + 98fc16e commit e971688
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion builtin/providers/rundeck/resource_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,14 @@ func jobToResourceData(job *rundeck.JobDetail, d *schema.ResourceData) error {
d.Set("id", job.ID)
d.Set("name", job.Name)
d.Set("group_name", job.GroupName)
d.Set("project_name", job.ProjectName)

// The project name is not consistently returned in all rundeck versions,
// so we'll only update it if it's set. Jobs can't move between projects
// anyway, so this is harmless.
if job.ProjectName != "" {
d.Set("project_name", job.ProjectName)
}

d.Set("description", job.Description)
d.Set("log_level", job.LogLevel)
d.Set("allow_concurrent_executions", job.AllowConcurrentExecutions)
Expand Down

0 comments on commit e971688

Please sign in to comment.