Code

Re-Added variable new_systems_ou.
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Sep 2008 06:32:05 +0000 (06:32 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Sep 2008 06:32:05 +0000 (06:32 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12384 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/gosa-si-server
gosa-si/server/events/gosaTriggered.pm

index 1807d9c824f1f5e88fdcd2fc7e0d82b44f2e2aca..7fc04abdd7eefdb7e87ac7f61b3d1243253a0032 100755 (executable)
@@ -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"],
index fd8544cfc5d37d8a0fac747b71626c479f399d60..0823eb0a967e286ec84748473871cf61eb79ec5e 100644 (file)
@@ -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);