summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 95445b9)
raw | patch | inline | side by side (parent: 95445b9)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 14 Mar 2008 10:31:02 +0000 (10:31 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 14 Mar 2008 10:31:02 +0000 (10:31 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9821 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-server | patch | blob | history |
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 368f1b15e5f665607b9fd14f2317e66dc33f928f..08ce86f68b98231c54af828b5d47924f23b46a95 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
# sending msg faild
if( $error ) {
- if (not $answer =~ /<header>trigger_action_reinstall<\/header>/) {
my $sql_statement = "UPDATE $job_queue_tn ".
"SET status='error', result='can not deliver msg, please consult log file' ".
"WHERE id='$jobdb_id'";
my $res = $job_db->update_dbentry($sql_statement);
- }
# sending msg was successful
} else {
# target of msg is a mac address
elsif( $answer_target =~ /^([0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2})$/i ) {
daemon_log("$session_id INFO: target is mac address '$answer_target', looking for host in known_clients", 5);
- my $sql_statement = "SELECT * FROM known_clients WHERE macaddress='$answer_target'";
+ my $sql_statement = "SELECT * FROM known_clients WHERE macaddress LIKE '$answer_target'";
my $query_res = $known_clients_db->select_dbentry( $sql_statement );
my $found_ip_flag = 0;
while( my ($hit_num, $hit) = each %{ $query_res } ) {
sub change_fai_state {
my ($st, $targets, $session_id) = @_;
$session_id = 0 if not defined $session_id;
-
# Set FAI state to localboot
my %mapActions= (
reboot => '',
# Return if this is unknown
if (!exists $mapActions{ $st }){
+ daemon_log("$session_id ERROR: unknown action '$st', can not translate ot FAIstate", 1);
return;
}
if( defined($ldap_handle) ) {
# Build search filter for hosts
- my $search= "(&(objectClass=GOhard)";
- foreach (@{$targets}){
- $search.= "(macAddress=$_)";
- }
- $search.= ")";
+ my $search= "(&(objectClass=GOhard)";
+ foreach (@{$targets}){
+ $search.= "(macAddress=$_)";
+ }
+ $search.= ")";
# If there's any host inside of the search string, procress them
- if (!($search =~ /macAddress/)){
- return;
- }
+ if (!($search =~ /macAddress/)){
+ daemon_log("$session_id ERROR: no macAddress found in filter statement for LDAP search: '$search'", 1);
+ return;
+ }
# Perform search for Unit Tag
my $mesg = $ldap_handle->search(
filter => "$search"
);
+#print STDERR "=============================================\n$search\n";
if ($mesg->count) {
my @entries = $mesg->entries;
foreach my $entry (@entries) {
daemon_log("$session_id Error: Setting FAIstate to '$state' for ".$entry->dn. "failed: ".$result->error, 1);
}
- }
+ } else {
+ daemon_log("$session_id DEBUG FAIstate at host found with filter statement '$search' already at state '$st'", 7);
+ }
}
}
+ # if no ldap handle defined
+ } else {
+ daemon_log("$session_id ERROR: no LDAP handle defined for update FAIstate", 1);
}
}