summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 583fc2e)
raw | patch | inline | side by side (parent: 583fc2e)
author | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 20 Feb 2009 15:50:17 +0000 (15:50 +0000) | ||
committer | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 20 Feb 2009 15:50:17 +0000 (15:50 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13435 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-server | patch | blob | history | |
gosa-si/modules/ClientPackages.pm | patch | blob | history |
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 29542324b1d5628adf6d59b2808c51224e534ca5..514e8b1bde1f54442d4e053c6c7d3d9025959613 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
sub watch_for_done_jobs {
- #CHECK: $heap for what?
- my ($kernel,$heap) = @_[KERNEL, HEAP];
+ #CHECK: $heap for what?
+ my ($kernel,$heap) = @_[KERNEL, HEAP];
- my $sql_statement = "SELECT * FROM ".$job_queue_tn." WHERE ((status='done') AND (modified='0'))";
+ my $sql_statement = "SELECT * FROM ".$job_queue_tn." WHERE ((status='done') AND (modified='0'))";
my $res = $job_db->select_dbentry( $sql_statement );
- while( my ($id, $hit) = each %{$res} ) {
- my $jobdb_id = $hit->{id};
- my $sql_statement = "DELETE FROM $job_queue_tn WHERE id=$jobdb_id";
- my $res = $job_db->del_dbentry($sql_statement);
- }
+ while( my ($id, $hit) = each %{$res} ) {
+ my $jobdb_id = $hit->{id};
+ my $sql_statement = "DELETE FROM $job_queue_tn WHERE id=$jobdb_id";
+ my $res = $job_db->del_dbentry($sql_statement);
+ }
- $kernel->delay_set('watch_for_done_jobs',$job_queue_loop_delay);
+ $kernel->delay_set('watch_for_done_jobs',$job_queue_loop_delay);
}
attrs => [],
filter => "(&(objectClass=organizationalUnit)(ou=fai))",
);
- if($mesg->{'resultCode'} == 0 &&
- $mesg->count != 0) {
+ if(($mesg->code == 0) && ($mesg->count != 0))
+ {
+ daemon_log("$session_id DEBUG: create_fai_release_db: count " . $mesg->count,8);
+
# Walk through all possible FAI container ou's
my @sql_list;
my $timestamp= &get_time();
}
}
- daemon_log("$session_id DEBUG: Inserting ".scalar @sql_list." entries to DB",8);
+ daemon_log("$session_id DEBUG: create_fai_release_db: Inserting ".scalar @sql_list." entries to DB",8);
if(@sql_list) {
+ unshift @sql_list, "VACUUM";
unshift @sql_list, "DELETE FROM $table_name";
$fai_release_db->exec_statementlist(\@sql_list);
}
- daemon_log("$session_id DEBUG: Done with inserting",7);
+ daemon_log("$session_id DEBUG: create_fai_release_db: Done with inserting",7);
+ } else {
+ daemon_log("$session_id INFO: create_fai_release_db: error: " . $mesg->code, 5);
}
daemon_log("$session_id INFO: create_fai_release_db: finished",5);
}
foreach my $entry (@{$mesg->{entries}}) {
if($entry->exists('cn')) {
my $tmp_dn= $entry->dn();
+ $tmp_dn= substr( $tmp_dn, 0, length($tmp_dn)
+ - length($fai_base) - 1 );
# Skip classname and ou dn parts for class
- my $tmp_release = ($1) if $tmp_dn =~ /^[^,]+,[^,]+,(.*?),$fai_base$/;
+ my $tmp_release = ($1) if $tmp_dn =~ /^[^,]+,[^,]+,(.*?)$/;
# Skip classes without releases
if((!defined($tmp_release)) || length($tmp_release)==0) {
}
} elsif (!$entry->exists('cn')) {
my $tmp_dn= $entry->dn();
- my $tmp_release = ($1) if $tmp_dn =~ /^(.*?),$fai_base$/;
+ $tmp_dn= substr( $tmp_dn, 0, length($tmp_dn)
+ - length($fai_base) - 1 );
+ my $tmp_release = ($1) if $tmp_dn =~ /^(.*?)$/;
# Skip classes without releases
if((!defined($tmp_release)) || length($tmp_release)==0) {
}
}
+ unshift(@new_statement_list, "VACUUM");
+
@packages_list_statements = @new_statement_list;
}
unlink($dest);
daemon_log("$session_id DEBUG: delete file '$dest'", 5);
} else {
- daemon_log("$session_id ERROR: create_packages_list_db: get_packages: fetching '$url' failed!", 1);
+ daemon_log("$session_id ERROR: create_packages_list_db: get_packages: fetching '$url' into '$dest' failed!", 1);
}
return 0;
}
index b21fb33032e32616c13cdb62aed9c4726032ca73..99bb3506909d66fbcae153ea52daeb6efc0b0bce 100644 (file)
}
my $entry= $ldap_res->entry(0);
- my $dn = &Net::LDAP::Util::escape_dn_value($entry->dn);
+ my $filter_dn = &Net::LDAP::Util::escape_filter_value($entry->dn);
my $syslog_server = $entry->get_value("gotoSyslogServer");
# If no syslog server is specified at host, just have a look at the object group of the host
my $ldap_res = $ldap_handle->search( base => $ldap_base,
scope => 'sub',
attrs => ['gotoSyslogServer'],
- filter => "(&(objectClass=gosaGroupOfNames)(member=$dn))");
+ filter => "(&(objectClass=gosaGroupOfNames)(member=$filter_dn))");
if($ldap_res->code) {
&main::daemon_log("$session_id ".$ldap_res->error, 1);
return;
"\n\tbase: $ldap_base".
"\n\tscope: sub".
"\n\tattrs: gotoSyslogServer".
- "\n\tfilter: (&(objectClass=gosaGroupOfNames)(member=$dn))", 1);
+ "\n\tfilter: (&(objectClass=gosaGroupOfNames)(member=$filter_dn))", 1);
return;
}
&main::daemon_log("$session_id WARNING: no syslog server specified for this host '$mac_address'", 3);
return;
}
+
# Add syslog server to 'syslog_config' message
my $syslog_msg_hash = &create_xml_hash("new_syslog_config", $server_address, $mac_address);
}
my $entry= $ldap_res->entry(0);
- my $dn = &Net::LDAP::Util::escape_dn_value($entry->dn);
+ my $filter_dn = &Net::LDAP::Util::escape_filter_value($entry->dn);
my @ntp_servers= $entry->get_value("gotoNtpServer");
# If no ntp server is specified at host, just have a look at the object group of the host
my $ldap_res = $ldap_handle->search( base => $ldap_base,
scope => 'sub',
attrs => ['gotoNtpServer'],
- filter => "(&(objectClass=gosaGroupOfNames)(member=$dn))");
+ filter => "(&(objectClass=gosaGroupOfNames)(member=$filter_dn))");
if($ldap_res->code) {
&main::daemon_log("$session_id ".$ldap_res->error, 1);
return;
"\n\tbase: $ldap_base".
"\n\tscope: sub".
"\n\tattrs: gotoNtpServer".
- "\n\tfilter: (&(objectClass=gosaGroupOfNames)(member=$dn))", 1);
+ "\n\tfilter: (&(objectClass=gosaGroupOfNames)(member=$filter_dn))", 1);
return;
}
}
my $entry= $mesg->entry(0);
- my $dn= $entry->dn;
+ my $filter_dn= &Net::LDAP::Util::escape_filter_value($entry->dn);
my @servers= $entry->get_value("gotoLdapServer");
my $unit_tag= $entry->get_value("gosaUnitTag");
my @ldap_uris;
my $server;
my $base;
my $release;
+ my $dn= $entry->dn;
# Fill release if available
my $FAIclass= $entry->get_value("FAIclass");
# Do we need to look at an object class?
if (not @servers){
- my $escaped_dn = &Net::LDAP::Util::escape_dn_value($dn);
$mesg = $ldap_handle->search( base => $ldap_base,
scope => 'sub',
attrs => ['dn', 'gotoLdapServer', 'FAIclass'],
- filter => "(&(objectClass=gosaGroupOfNames)(member=$escaped_dn))");
+ filter => "(&(objectClass=gosaGroupOfNames)(member=$filter_dn))");
if($mesg->code) {
- &main::daemon_log("$session_id ERROR: unable to search for '(&(objectClass=gosaGroupOfNames)(member=$dn))': ".$mesg->error, 1);
+ &main::daemon_log("$session_id ERROR: unable to search for '(&(objectClass=gosaGroupOfNames)(member=$filter_dn))': ".$mesg->error, 1);
return;
}
"\n\tbase: $ldap_base".
"\n\tscope: sub".
"\n\tattrs: dn, gotoLdapServer, FAIclass".
- "\n\tfilter: (&(objectClass=gosaGroupOfNames)(member=$escaped_dn))", 1);
+ "\n\tfilter: (&(objectClass=gosaGroupOfNames)(member=$filter_dn))", 1);
return;
}
} else {
my $entry= $mesg->entry(0);
- my $dn= $entry->dn;
if (defined($entry->get_value("gotoHardwareChecksum"))) {
if (! $entry->get_value("gotoHardwareChecksum") eq $gotoHardwareChecksum) {
$entry->replace(gotoHardwareChecksum => $gotoHardwareChecksum);