summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5038984)
raw | patch | inline | side by side (parent: 5038984)
author | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 11 Sep 2008 09:59:25 +0000 (09:59 +0000) | ||
committer | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 11 Sep 2008 09:59:25 +0000 (09:59 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12417 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/server/events/gosaTriggered.pm | patch | blob | history |
index 6aeae783e87a917ae638f343fdca1492ec206cb4..3ffdf5719ea8a549be732183929cb9211169305f 100644 (file)
if($ldap_mesg->count == 1) {
$ogroup_entry= $ldap_mesg->pop_entry();
} elsif ($ldap_mesg->count == 0) {
- &main::daemon_log("ERROR: A GosaGroupOfNames with cn '$ogroup' was not found in base '".$main::ldap_base."'!", 1);
+ &main::daemon_log("$session_id ERROR: A GosaGroupOfNames with cn '$ogroup' was not found in base '".$main::ldap_base."'!", 1);
$main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET status = 'waiting' WHERE id = $jobdb_id");
$main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET timestamp = '".&get_time(10)."' WHERE id = $jobdb_id");
return undef;
} else {
- &main::daemon_log("ERROR: More than one ObjectGroups with cn '$ogroup' was found in base '".$main::ldap_base."'!", 1);
+ &main::daemon_log("$session_id ERROR: More than one ObjectGroups with cn '$ogroup' was found in base '".$main::ldap_base."'!", 1);
$main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET status = 'waiting' WHERE id = $jobdb_id");
$main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET timestamp = '".&get_time(10)."' WHERE id = $jobdb_id");
return undef;
if(!(defined($base) && (length($base) > 0))) {
# Subtract the ObjectGroup cn
$base = $1 if $ogroup_entry->dn =~ /cn=$ogroup,ou=groups,(.*)$/;
- &main::daemon_log("DEBUG: New base for system with mac address '$mac' is '$base'", 5);
+ &main::daemon_log("$session_id DEBUG: New base for system with mac address '$mac' is '$base'", 5);
}
}
# 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."'!", 5);
+ &main::daemon_log("$session_id DEBUG: One system with mac address '$mac' was found in base '".$main::ldap_base."'!", 5);
# Get the entry from LDAP
$ldap_entry= $ldap_mesg->pop_entry();
# To prevent replication problems just re-queue the job with 10 seconds in the future
my $moddn_result = $ldap_entry->update($ldap_handle);
if ($moddn_result->code() != 0) {
- &main::daemon_log("ERROR: Moving the system with mac address '$mac' to new base '$base' failed (code '".$moddn_result->code()."') with '".$moddn_result->{'errorMessage'}."'!", 1);
+ &main::daemon_log("$session_id ERROR: Moving the system with mac address '$mac' to new base '$base' failed (code '".$moddn_result->code()."') with '".$moddn_result->{'errorMessage'}."'!", 1);
$main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET status = 'waiting' WHERE id = $jobdb_id");
$main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET timestamp = '".&get_time(10)."' WHERE id = $jobdb_id");
return undef;
} else {
- &main::daemon_log("INFO: System with mac address '$mac' was moved to base '".$main::ldap_base."'! Re-queuing job.", 4);
+ &main::daemon_log("$session_id INFO: System with mac address '$mac' was moved to base '".$main::ldap_base."'! Re-queuing job.", 4);
$main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET status = 'waiting' WHERE id = $jobdb_id");
$main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET timestamp = '".&get_time(10)."' WHERE id = $jobdb_id");
return undef;
}
} elsif ($ldap_mesg->count == 0) {
- &main::daemon_log("WARNING: No System with mac address '$mac' was found in base '".$main::ldap_base."'! Re-queuing job.", 4);
+ &main::daemon_log("$session_id WARNING: No System with mac address '$mac' was found in base '".$main::ldap_base."'! Re-queuing job.", 4);
$main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET status = 'waiting' WHERE id = $jobdb_id");
$main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET timestamp = '".&get_time(60)."' WHERE id = $jobdb_id");
return undef;
my $oclasses = $ldap_entry->get_value('objectClass', asref => 1);
foreach my $oclass ("FAIobject", "GOhard", "gotoWorkstation") {
if(!(scalar grep $_ eq $oclass, map {$_ => 1} @$oclasses)) {
- &main::daemon_log("Adding objectClass $oclass", 1);
+ &main::daemon_log("$session_id INFO: Adding objectClass '$oclass' to system entry with mac adress '$mac'", 1);
$ldap_entry->add(
objectClass => $oclass,
);
my $oclass_result = $ldap_entry->update($ldap_handle);
if ($oclass_result->code() != 0) {
- &main::daemon_log("ERROR: Adding the ObjectClass '$oclass' failed (code '".$oclass_result->code()."') with '".$oclass_result->{'errorMessage'}."'!", 1);
+ &main::daemon_log("$session_id ERROR: Adding the ObjectClass '$oclass' failed (code '".$oclass_result->code()."') with '".$oclass_result->{'errorMessage'}."'!", 1);
}
}
}
);
my $replace_result = $ldap_entry->update($ldap_handle);
if ($replace_result->code() != 0) {
- &main::daemon_log("ERROR: Setting the FAIstate to install failed with code '".$replace_result->code()."') and message '".$replace_result->{'errorMessage'}."'!", 1);
+ &main::daemon_log("$session_id ERROR: Setting the FAIstate to install failed with code '".$replace_result->code()."') and message '".$replace_result->{'errorMessage'}."'!", 1);
}
}
} else {
);
my $add_result = $ldap_entry->update($ldap_handle);
if ($add_result->code() != 0) {
- &main::daemon_log("ERROR: Setting the FAIstate to install failed with code '".$add_result->code()."') and message '".$add_result->{'errorMessage'}."'!", 1);
+ &main::daemon_log("$session_id ERROR: Setting the FAIstate to install failed with code '".$add_result->code()."') and message '".$add_result->{'errorMessage'}."'!", 1);
}
}
# TODO: Create a new entry
# $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::daemon_log("$session_id WARNING: No System with mac address '$mac' was found in base '".$main::ldap_base."'! Re-queuing job.", 4);
$main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET status = 'waiting' WHERE id = $jobdb_id");
$main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET timestamp = '".&get_time(10)."' WHERE id = $jobdb_id");
return undef;
} else {
- &main::daemon_log("ERROR: More than one system with mac address '$mac' was found in base '".$main::ldap_base."'!", 1);
+ &main::daemon_log("$session_id ERROR: More than one system with mac address '$mac' was found in base '".$main::ldap_base."'!", 1);
}
# Add to ObjectGroup
);
my $ogroup_result = $ogroup_entry->update($ldap_handle);
if ($ogroup_result->code() != 0) {
- &main::daemon_log("ERROR: Updating the ObjectGroup '$ogroup' failed (code '".$ogroup_result->code()."') with '".$ogroup_result->{'errorMessage'}."'!", 1);
+ &main::daemon_log("$session_id ERROR: Updating the ObjectGroup '$ogroup' failed (code '".$ogroup_result->code()."') with '".$ogroup_result->{'errorMessage'}."'!", 1);
}
} else {
- &main::daemon_log("DEBUG: System with mac address '$mac' is already a member of ObjectGroup '$ogroup'.", 5);
+ &main::daemon_log("$session_id DEBUG: System with mac address '$mac' is already a member of ObjectGroup '$ogroup'.", 5);
}
# Finally set gotoMode to active
);
my $activate_result = $ldap_entry->update($ldap_handle);
if ($activate_result->code() != 0) {
- &main::daemon_log("ERROR: Activating system '".$ldap_entry->dn()."' failed (code '".$activate_result->code()."') with '".$activate_result->{'errorMessage'}."'!", 1);
+ &main::daemon_log("$session_id ERROR: Activating system '".$ldap_entry->dn()."' failed (code '".$activate_result->code()."') with '".$activate_result->{'errorMessage'}."'!", 1);
} else {
$activate_client = 1;
}
);
my $activate_result = $ldap_entry->update($ldap_handle);
if ($activate_result->code() != 0) {
- &main::daemon_log("ERROR: Activating system '".$ldap_entry->dn()."' failed (code '".$activate_result->code()."') with '".$activate_result->{'errorMessage'}."'!", 1);
+ &main::daemon_log("$session_id ERROR: Activating system '".$ldap_entry->dn()."' failed (code '".$activate_result->code()."') with '".$activate_result->{'errorMessage'}."'!", 1);
} else {
$activate_client = 1;
}
return @out_msg_l;
} else {
- &main::daemon_log("WARNING: Activating system with mac address '$mac' failed! Re-queuing job.", 4);
+ &main::daemon_log("$session_id WARNING: Activating system with mac address '$mac' failed! Re-queuing job.", 4);
$main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET status = 'waiting' WHERE id = $jobdb_id");
$main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET timestamp = '".&get_time(10)."' WHERE id = $jobdb_id");
}