Skip to content

Commit

Permalink
Fix upgrade issue with description null values
Browse files Browse the repository at this point in the history
  • Loading branch information
gschueler committed Sep 23, 2011
1 parent 88ae9d6 commit cd12226
Showing 1 changed file with 18 additions and 0 deletions.
Expand Up @@ -787,6 +787,12 @@ class ScheduledExecutionController {
def origgrouppath=scheduledExecution.groupPath
def origproject=scheduledExecution.project
scheduledExecution.properties = nonopts

//fix potential null/blank issue after upgrading rundeck to 1.3.1/1.4
if (!scheduledExecution.description) {
scheduledExecution.description = ''
}

if (origgrouppath != scheduledExecution.groupPath
|| origjobname != scheduledExecution.jobName
|| origproject != scheduledExecution.project) {
Expand Down Expand Up @@ -1148,6 +1154,12 @@ class ScheduledExecutionController {
def origgrouppath = scheduledExecution.groupPath
def origproject = scheduledExecution.project
scheduledExecution.properties = newprops

//fix potential null/blank issue after upgrading rundeck to 1.3.1/1.4
if (!scheduledExecution.description) {
scheduledExecution.description = ''
}

if (origgrouppath != scheduledExecution.groupPath
|| origjobname != scheduledExecution.jobName
|| origproject != scheduledExecution.project ) {
Expand Down Expand Up @@ -1741,6 +1753,12 @@ class ScheduledExecutionController {
final Map nonopts = params.findAll {!it.key.startsWith("option.") && it.key != 'workflow'&& it.key != 'options'&& it.key != 'notifications'}
final Map oldopts = params.findAll{it.key=~/^(name|command|type|adhocExecution|adhocFilepath|adhoc.*String)$/}
scheduledExecution.properties = nonopts

//fix potential null/blank issue after upgrading rundeck to 1.3.1/1.4
if(!scheduledExecution.description){
scheduledExecution.description=''
}

if(oldopts && !params.workflow){
//construct workflow with one item from these options
oldopts.project=scheduledExecution.project
Expand Down

0 comments on commit cd12226

Please sign in to comment.