[debian-edu-commits] r82899 - branches/wheezy/debian-edu-config/share/debian-edu-config/tools

pere at alioth.debian.org pere at alioth.debian.org
Sun Jan 5 14:04:24 UTC 2014


Author: pere
Date: 2014-01-05 14:04:24 +0000 (Sun, 05 Jan 2014)
New Revision: 82899

Modified:
   branches/wheezy/debian-edu-config/share/debian-edu-config/tools/ldap-migrate-squeeze-wheezy
Log:
Migrate computer LDAP objects too.

Modified: branches/wheezy/debian-edu-config/share/debian-edu-config/tools/ldap-migrate-squeeze-wheezy
===================================================================
--- branches/wheezy/debian-edu-config/share/debian-edu-config/tools/ldap-migrate-squeeze-wheezy	2014-01-05 13:54:34 UTC (rev 82898)
+++ branches/wheezy/debian-edu-config/share/debian-edu-config/tools/ldap-migrate-squeeze-wheezy	2014-01-05 14:04:24 UTC (rev 82899)
@@ -90,18 +90,24 @@
 my %curuser;
 my %curgroup;
 my %cursudorole;
+my %curhost;
 while (not $curldif->eof() ) {
     my $entry = $curldif->read_entry ( );
     if ( ! $curldif->error() ) {
         my %cls;
         map { $cls{$_} = 1 } $entry->get_value('objectClass');
-        if ( exists $cls{'posixAccount'} && exists $cls{'person'}
-             && ! exists $cls{'gosaUserTemplate'}) {
+        if (exists $cls{'posixAccount'} && exists $cls{'person'}
+            && ! exists $cls{'gosaUserTemplate'}
+            && ! exists $cls{'gotoWorkstation'}) {
             $curuser{$entry->get_value('uid')} = 1;
         } elsif (exists $cls{'posixGroup'} ) {
             $curgroup{$entry->get_value('cn')} = $entry;
         } elsif (exists $cls{'sudoRole'} ) {
             $cursudorole{$entry->get_value('cn')} = $entry;
+        } elsif (exists $cls{'device'}
+                 || exists $cls{'goServer'}
+                 || exists $cls{'gotoWorkstation'}) {
+            $curhost{$entry->get_value('cn')} = $entry;
         }
     }
 }
@@ -121,7 +127,8 @@
         my %cls;
         map { $cls{$_} = 1 } $entry->get_value('objectClass');
         if (exists $cls{'posixAccount'} && exists $cls{'person'}
-            && ! exists $cls{'gosaUserTemplate'}) {
+            && ! exists $cls{'gosaUserTemplate'}
+            && ! exists $cls{'gotoWorkstation'}) {
             my $uid = $entry->get_value('uid');
             if (!exists ($curuser{$uid})) {
                 $entry = trim_internal_attributes_from_entry($entry);
@@ -168,7 +175,14 @@
                 $entry = trim_internal_attributes_from_entry($entry);
                 $newldif->write_entry($entry);
             }
-
+        } elsif (exists $cls{'device'}
+                 || exists $cls{'goServer'}
+                 || exists $cls{'gotoWorkstation'}) {
+            my $cn = $entry->get_value('cn');
+            if (!exists ($curhost{$cn})) {
+                $entry = trim_internal_attributes_from_entry($entry);
+                $newldif->write_entry($entry);
+            }
         }
 #            print Dumper($entry);
     }




More information about the debian-edu-commits mailing list