From: rettenbe Date: Wed, 16 Sep 2009 10:26:46 +0000 (+0000) Subject: interface change for periodical jobs X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=42b9313c91f81dd815abf81ce7a665507e658b88;p=gosa.git interface change for periodical jobs git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14257 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/modules/GosaPackages.pm b/gosa-si/modules/GosaPackages.pm index decc502a8..f8cfeb72a 100644 --- a/gosa-si/modules/GosaPackages.pm +++ b/gosa-si/modules/GosaPackages.pm @@ -280,19 +280,13 @@ sub process_job_msg { # Check if it is a periodical job my $periodic = 'none'; - my $periodic_time = 1; if (exists $msg_hash->{periodic}) { $periodic = $msg_hash->{periodic}[0]; - if (not defined $periodic) # Periodic tag is not defined - { - $periodic = ""; - } - - if (not exists $main::check_periodic->{$periodic}) # Periodic tag is not valid + if (not $periodic =~ /[0-9]+_(hours|minutes|days|weeks|months)/) # Periodic tag is not valid { &main::daemon_log("$session_id ERROR: Message contains invalid periodic-tag '$periodic'.". - " Please use one of the following tags instead: '".join("', '", keys(%$main::check_periodic))."'.". + " Please use the following pattern for the tag: 'INTEGER_[minutes|hours|days|weeks|months]'". " Aborted message: $msg", 1); $out_msg = "". "
answer
$main::server_addressGOSA". @@ -300,41 +294,6 @@ sub process_job_msg { "
"; return ($out_msg); } - - if (exists $msg_hash->{$periodic}) # Check periodical time tag and set value - { - if (ref $msg_hash->{$periodic}[0] eq "HASH") # Periodical time tag is empty - { - &main::daemon_log("$session_id ERROR: Message contains no content of periodical time tag.". - " Please use an integer for this tag (i. e.: hours5)", 1); - $out_msg = "". - "
answer
$main::server_addressGOSA". - "1Message contains no content of periodic time tag". - "
"; - return ($out_msg); - - } - - if (not $msg_hash->{$periodic}[0] =~ /[1-9]+\d*/) # Periodical time tag is not an INT > 0 - { - &main::daemon_log("$session_id ERROR: Message contains invalid periodical time tag '$msg_hash->{$periodic}[0]'.". - " Please use an integer for this tag (i. e.: hours5)", 1); - $out_msg = "". - "
answer
$main::server_addressGOSA". - "1Message contains invalid periodic time tag '$msg_hash->{$periodic}[0]'". - "
"; - return ($out_msg); - } - - $periodic_time = $msg_hash->{$periodic}[0]; - } - } - - # Default db value is 'none' otherwise use systax /\d+_$periodic/ - my $db_periodic_value = 'none'; - if ($periodic ne 'none') - { - $db_periodic_value = $periodic_time."_".$periodic; } # Add job to job queue @@ -352,7 +311,7 @@ sub process_job_msg { plainname=>$plain_name, siserver=>"localhost", modified=>"1", - periodic=>$db_periodic_value, + periodic=>$periodic, }; my $res = $main::job_db->add_dbentry($func_dic); if (not $res == 0) { diff --git a/gosa-si/tests/client.php b/gosa-si/tests/client.php index 4c16e6cef..3e0ff53de 100755 --- a/gosa-si/tests/client.php +++ b/gosa-si/tests/client.php @@ -19,7 +19,7 @@ for($count = 1; $count <= $zahl; $count++) # Funktioniert noch nicht #$data = "
gosa_opsi_test
GOSA00:01:6C:9D:B9:FAacroread
"; - $data = "
gosa_opsi_getLicenseInformationForProduct
GOSA00:01:6C:9D:B9:FAacroread
"; + #$data = "
gosa_opsi_getLicenseInformationForProduct
GOSA00:01:6C:9D:B9:FAacroread
"; #$data = "
gosa_opsi_getLicensePools_listOfHashes
GOSA00:01:6C:9D:B9:FA
"; @@ -46,7 +46,7 @@ for($count = 1; $count <= $zahl; $count++) ############################## # periodical jobs - #$data = "
job_trigger_action_reboot
GOSA00:0c:29:4c:4b:0c00:0c:29:4c:4b:0c20090629000000weeks2
"; + #$data = "
job_trigger_action_reboot
GOSA00:0c:29:4c:4b:0c00:0c:29:4c:4b:0c234506290000003_months
"; #$data = "
job_trigger_action_reboot
GOSA00:0c:29:4c:4b:0c2009062613500000:0c:29:4c:4b:0cminutes5
"; /* Prepare a hunge bunch of data to be send */ # jobdb add @@ -64,7 +64,7 @@ for($count = 1; $count <= $zahl; $count++) #$data = "
gosa_trigger_reload_ldap_config
GOSA00:0C:29:4C:4B:0C
"; # jobdb update - #$data = "
gosa_update_status_jobdb_entry
GOSA GOSA 1 19700101000000
"; + #$data = "
gosa_update_status_jobdb_entry
GOSA GOSA 1 12_weeks
"; #$data = "
gosa_update_status_jobdb_entry
GOSAGOSA 00:01:6c:9d:b9:fa processing update
"; # jobdb query