From d2f2a734736784c5bda3eae332583ef60f77109b Mon Sep 17 00:00:00 2001 From: cajus Date: Fri, 8 Feb 2008 14:42:17 +0000 Subject: [PATCH] Added release to ldap-shell.conf git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8784 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/gosa-si-client | 6 ++++++ gosa-si/modules/SIPackages.pm | 9 ++++++++- gosa-si/modules/Utils.pm | 4 +++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client index a56d54891..d4e17c29f 100755 --- a/gosa-si/gosa-si-client +++ b/gosa-si/gosa-si-client @@ -470,6 +470,7 @@ sub new_ldap_config { my $goto_secret; my $admin_base= ""; my $department= ""; + my $release= ""; my $unit_tag; # Transform input into array @@ -519,6 +520,10 @@ sub new_ldap_config { $unit_tag= $element; next; } + if ($key =~ /^release$/) { + $release= $element; + next; + } } } @@ -589,6 +594,7 @@ sub new_ldap_config { print file1 "LDAP_BASE=\"$ldap_base\"\n"; print file1 "ADMIN_BASE=\"$admin_base\"\n"; print file1 "DEPARTMENT=\"$department\"\n"; + print file1 "RELEASE=\"$release\"\n"; print file1 "UNIT_TAG=\"".(defined $unit_tag ? "$unit_tag" : "")."\"\n"; print file1 "UNIT_TAG_FILTER=\"".(defined $unit_tag ? "(gosaUnitTag=$unit_tag)" : "")."\"\n"; close(file1); diff --git a/gosa-si/modules/SIPackages.pm b/gosa-si/modules/SIPackages.pm index fa4d03fd5..22e052455 100644 --- a/gosa-si/modules/SIPackages.pm +++ b/gosa-si/modules/SIPackages.pm @@ -764,7 +764,7 @@ sub new_ldap_config { # Find admin base and department name $mesg = $ldap->search( base => $ldap_base, scope => 'sub', - attrs => ['dn', 'ou'], + attrs => ['dn', 'ou', 'FAIclass'], filter => "(&(objectClass=gosaAdministrativeUnit)(gosaUnitTag=$unit_tag))"); #$mesg->code && die $mesg->error; if($mesg->code) { @@ -782,6 +782,12 @@ sub new_ldap_config { $data{'admin_base'}= $entry->dn; $data{'department'}= $entry->get_value("ou"); + # Fill release if available + my $ou= $entry->get_value("ou"); + if (defined $ou && $ou ~= /^.* :([A-Za-z0-9/.]+).*$/){ + $data{'release'}= $1; + } + # Append unit Tag $data{'unit_tag'}= $unit_tag; } @@ -847,6 +853,7 @@ sub process_detected_hardware { $entry->add("objectClass" => "goHard"); $entry->add("cn" => $cn); $entry->add("macAddress" => $macaddress); + $entry->add("gotomode" => "locked"); $entry->add("gotoSysStatus" => "new-system"); $entry->add("ipHostNumber" => $ipaddress); if(my $res=$entry->update($ldap)) { diff --git a/gosa-si/modules/Utils.pm b/gosa-si/modules/Utils.pm index a5c90d9e4..d5954dd9d 100644 --- a/gosa-si/modules/Utils.pm +++ b/gosa-si/modules/Utils.pm @@ -123,7 +123,9 @@ sub process_input($) %result = ( 'status' => 0, 'percent' => 16, 'task' => "task_instsoft", 'action' => gettext("Gathering information for package lists")); } elsif ( $line =~ /([0-9]+) packages upgraded, ([0-9]+) newly installed/ ) { - $pkg_step= 69.0 / ($1 + $2) / 3.0; + if (($1 + $2) != 0){ + $pkg_step= 69.0 / ($1 + $2) / 3.0; + } $percent= 16.0; } elsif ( $line =~ /Get:[0-9]+ [^ ]+ [^ ]+ ([^ ]+)/ ) { $percent+= $pkg_step; -- 2.30.2