Code

Added release to ldap-shell.conf
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 8 Feb 2008 14:42:17 +0000 (14:42 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 8 Feb 2008 14:42:17 +0000 (14:42 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8784 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/gosa-si-client
gosa-si/modules/SIPackages.pm
gosa-si/modules/Utils.pm

index a56d548916d151d359450da6e10174d3a69baf66..d4e17c29f187f21dbe6cbc92efe4b16b76c7e468 100755 (executable)
@@ -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);
index fa4d03fd5b948e8200649f76c8ca88446aff6da4..22e052455cc08decb1db929d8e637f3e7c64b5ba 100644 (file)
@@ -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)) {
index a5c90d9e4ce36f110c996ad56f9fcff281fec671..d5954dd9d993d19bd8c19a8d37ce4ef5cdd7fba9 100644 (file)
@@ -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;