summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 006bab0)
raw | patch | inline | side by side (parent: 006bab0)
author | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 14 Feb 2008 13:28:46 +0000 (13:28 +0000) | ||
committer | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 14 Feb 2008 13:28:46 +0000 (13:28 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8913 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/modules/SIPackages.pm | patch | blob | history |
index ef5081e34f4a4c41c9bb964761201feb56be6dc5..0be8a5d92485ee1d2c19a3e87bab748e277edb25 100644 (file)
# Read gosaUnitTag from LDAP
my $tmp_ldap= Net::LDAP->new($ldap_uri);
if(defined($tmp_ldap)) {
+ &main::daemon_log("Searching for servers gosaUnitTag with mac address $server_mac_address",6);
my $mesg= $tmp_ldap->bind($ldap_admin_dn, password => $ldap_admin_password);
# Perform search for Unit Tag
$mesg = $tmp_ldap->search(
&main::daemon_log("Detected gosaUnitTag $unit_tag for creating entries", 4);
$gosa_unit_tag= $unit_tag;
}
- $mesg = $tmp_ldap->unbind;
} else {
- &main::daemon_log("Not using gosaUnitTag",8);
+ # Perform another search for Unit Tag
+ my $hostname= `hostname -f`;
+ $mesg = $tmp_ldap->search(
+ base => $ldap_base,
+ scope => 'sub',
+ attrs => ['gosaUnitTag'],
+ filter => "(&(cn=$hostname)(objectClass=goServer))"
+ );
+ if ($mesg->count == 1) {
+ my $entry= $mesg->entry(0);
+ my $unit_tag= $entry->get_value("gosaUnitTag");
+ if(defined($unit_tag) && length($unit_tag) > 0) {
+ &main::daemon_log("Detected gosaUnitTag $unit_tag for creating entries", 4);
+ $gosa_unit_tag= $unit_tag;
+ }
+ } else {
+ # Perform another search for Unit Tag
+ $hostname= `hostname -s`;
+ $mesg = $tmp_ldap->search(
+ base => $ldap_base,
+ scope => 'sub',
+ attrs => ['gosaUnitTag'],
+ filter => "(&(cn=$hostname)(objectClass=goServer))"
+ );
+ if ($mesg->count == 1) {
+ my $entry= $mesg->entry(0);
+ my $unit_tag= $entry->get_value("gosaUnitTag");
+ if(defined($unit_tag) && length($unit_tag) > 0) {
+ &main::daemon_log("Detected gosaUnitTag $unit_tag for creating entries", 4);
+ $gosa_unit_tag= $unit_tag;
+ }
+ } else {
+ &main::daemon_log("Not using gosaUnitTag", 6);
+ }
+ }
}
+ } else {
+ &main::daemon_log("Using gosaUnitTag from config-file: $gosa_unit_tag",6);
}
-} else {
- &main::daemon_log("Using gosaUnitTag from config-file: $gosa_unit_tag",6);
+ $tmp_ldap->unbind;
}
# complete addresses