diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2002-04-25 12:32:48 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2002-04-25 12:32:48 +0000 |
commit | b27d1f0e4b44be323acc826429ca8b3e2d990a3d (patch) | |
tree | 65e434900a2795f3e99ee7633071d6066c93c8f1 /lib/sbin/CreateScheduleBindings.pl | |
parent | 9ae1f86b3a5075fe203089a2bf1a5c90d53d8599 (diff) |
Fix logic for detecting attempt to try to activate more timelevels than
actually exist for a group, also prettyfied the error message for the 1
timelevel case.
Fixes PR 981.
Tom
git-svn-id: http://svn.cactuscode.org/flesh/trunk@2753 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/CreateScheduleBindings.pl')
-rw-r--r-- | lib/sbin/CreateScheduleBindings.pl | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/sbin/CreateScheduleBindings.pl b/lib/sbin/CreateScheduleBindings.pl index 5acdf431..0d360905 100644 --- a/lib/sbin/CreateScheduleBindings.pl +++ b/lib/sbin/CreateScheduleBindings.pl @@ -916,7 +916,7 @@ sub ScheduleSelectVars sub ScheduleValidateTimeLevels { my($thorn, $implementation, $groups,$timelevels_list, $rhinterface_db) = @_; - + my $i; my $return_code; @@ -971,18 +971,22 @@ sub ScheduleValidateTimeLevels ,"",__LINE__,__FILE__); $return_code++; } - elsif($timelevels <= $allowed_timelevels) - { - next; - } - elsif($timelevels > 0) + elsif($timelevels > 0 && $timelevels <= $allowed_timelevels) { next; } else { - &CST_error(0,"Tried to schedule $timelevels timelevels for group '$group' in schedule.ccl of thorn '$thorn'\n" . - "Value must be between 1 and $allowed_timelevels (inclusive)","",__LINE__,__FILE__); + if($allowed_timelevels > 1) + { + &CST_error(0,"Tried to schedule $timelevels timelevels for group '$group' in schedule.ccl of thorn '$thorn'\n" . + "Value must be between 1 and $allowed_timelevels (inclusive)","",__LINE__,__FILE__); + } + else + { + &CST_error(0,"Tried to schedule $timelevels timelevels for group '$group' in schedule.ccl of thorn '$thorn'\n" . + "This variable has one timelevel only","",__LINE__,__FILE__); + } $return_code++; } } |