From: janw Date: Wed, 10 Sep 2008 06:32:05 +0000 (+0000) Subject: Re-Added variable new_systems_ou. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=baec22aa8e54bd6d649a7fa0935cb1334d985770;p=gosa.git Re-Added variable new_systems_ou. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12384 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index 1807d9c82..7fc04abdd 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -87,6 +87,7 @@ our (%cfg_defaults, $log_file, $pid_file, $wake_on_lan_passwd, $job_synchronization, $modified_jobs_loop_delay, $arp_enabled, $arp_interface, $opsi_enabled, $opsi_server, $opsi_admin, $opsi_password, + $new_systems_ou, ); # additional variable which should be globaly accessable @@ -247,6 +248,7 @@ our $logged_in_user_date_of_expiry = 600; "job-queue-loop-delay" => [\$job_queue_loop_delay, 3], "messaging-db-loop-delay" => [\$messaging_db_loop_delay, 3], "key" => [\$GosaPackages_key, "none"], + "new-systems-ou" => [\$new_systems_ou, 'ou=systems'], }, "ClientPackages" => { "key" => [\$ClientPackages_key, "none"], diff --git a/gosa-si/server/events/gosaTriggered.pm b/gosa-si/server/events/gosaTriggered.pm index fd8544cfc..0823eb0a9 100644 --- a/gosa-si/server/events/gosaTriggered.pm +++ b/gosa-si/server/events/gosaTriggered.pm @@ -804,7 +804,6 @@ sub trigger_activate_new { my $changed_attributes_counter = 0; eval { - my $ldap_mesg= $ldap_handle->search( base => $main::ldap_base, scope => 'sub', @@ -835,7 +834,6 @@ sub trigger_activate_new { ); # TODO: Find a way to guess an ip address for hosts with no ldap entry (MAC->ARP->IP) - if($ldap_mesg->count == 1) { &main::daemon_log("DEBUG: One system with mac address '$mac' was found in base '".$main::ldap_base."'!", 6); # Get the entry from LDAP @@ -860,7 +858,6 @@ sub trigger_activate_new { ); # TODO: Find a way to guess an ip address for hosts with no ldap entry (MAC->ARP->IP) - if($ldap_mesg->count == 1) { $ldap_entry= $ldap_mesg->pop_entry(); # Check for needed objectClasses @@ -896,7 +893,8 @@ sub trigger_activate_new { # $ldap_entry = Net::LDAP::Entry->new(); # $ldap_entry->dn("cn=$mac,$base"); &main::daemon_log("WARNING: No System with mac address '$mac' was found in base '".$main::ldap_base."'! Re-queuing job.", 4); - $main::job_db->exec_statement("UPDATE jobs SET status = 'waiting', timestamp = '".&get_time()."' WHERE id = $jobdb_id"); + $main::job_db->exec_statement("UPDATE jobs SET status = 'waiting' WHERE id = $jobdb_id"); + $main::job_db->exec_statement("UPDATE jobs SET timestamp = '".&get_time()."' WHERE id = $jobdb_id"); return; } else { &main::daemon_log("ERROR: More than one system with mac address '$mac' was found in base '".$main::ldap_base."'!", 1); @@ -938,8 +936,8 @@ sub trigger_activate_new { &main::daemon_log("ERROR: activate_new failed with '$@'!", 1); } - # Delete job - $main::job_db->exec_statement("DELETE FROM jobs WHERE id = $jobdb_id"); + # Set job to done + $main::job_db->exec_statement("UPDATE jobs SET status = 'done' WHERE id = $jobdb_id"); # create set_activated_for_installation message for delivery my $out_hash = &create_xml_hash("set_activated_for_installation", $source, $target);