fixed fixed error on stop_downtime

This commit is contained in:
marcos.alconada 2019-09-11 10:04:18 +02:00
parent 16912732d2
commit 329cafad49
1 changed files with 19 additions and 0 deletions

View File

@ -4818,6 +4818,25 @@ sub cli_stop_downtime () {
my $current_time = time;
my $downtime_date_to = get_db_value ($dbh, 'SELECT date_to FROM tplanned_downtime WHERE id=?', $downtime_id);
my $type_execution = get_db_value ($dbh, 'SELECT type_execution FROM tplanned_downtime WHERE id=?', $downtime_id);
if($type_execution eq 'periodically'){
my $downtime_running = get_db_value ($dbh, 'SELECT executed FROM tplanned_downtime WHERE id=?', $downtime_id);
if($downtime_running == 1){
print_log "[INFO] Planned_downtime '$downtime_name' can't be stopped\n\n";
exit;
}
}
if($current_time >= $downtime_date_to) {
print_log "[INFO] Planned_downtime '$downtime_name' is already stopped\n\n";
exit;
}
if($current_time >= $downtime_date_to) {
print_log "[INFO] Planned_downtime '$downtime_name' is already stopped\n\n";
exit;