Bug 26104 - check_group_recursion führt zu traceback
check_group_recursion führt zu traceback
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM - CLI
UCS 3.0
Other Linux
: P5 normal (vote)
: UCS 3.0-1-errata
Assigned To: Alexander Kläser
Andreas Büsching
:
Depends on:
Blocks: 27199
  Show dependency treegraph
 
Reported: 2012-02-13 14:06 CET by Kevin Dominik Korte
Modified: 2012-11-09 16:33 CET (History)
4 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Dominik Korte univentionstaff 2012-02-13 14:06:36 CET
Das aufrufen von check_group_recursion führt zu einem Traceback


# /usr/share/univention-directory-manager-tools/check_group_recursion 
Traceback (most recent call last):
  File "/usr/share/univention-directory-manager-tools/check_group_recursion", line 164, in <module>
    main()
  File "/usr/share/univention-directory-manager-tools/check_group_recursion", line 129, in main
    univention.admin.modules.init(lo, position, grp_module)
  File "/usr/lib/pymodules/python2.6/univention/admin/modules.py", line 101, in init
    univention.admin.ucr_overwrite_properties( module, lo )
  File "/usr/lib/pymodules/python2.6/univention/admin/__init__.py", line 51, in ucr_overwrite_properties
    ucr_prefix = 'directory/manager/web/modules/%s/properties/' % module.module
AttributeError: 'NoneType' object has no attribute 'module

Aufgefallen an Ticket 2012011121004224
Comment 1 Andreas Büsching univentionstaff 2012-02-13 14:32:58 CET
Da scheint ein einmaliges

univention.admin.modules.update()

zu fehlen. Das ist eine API-Änderung aus UCS 3.0
Comment 2 Alexander Kläser univentionstaff 2012-03-28 17:50:32 CEST
Nach dem die Funktion update() aufgerufen wurde trat folgender Traceback auf:

> root@master26:~# /usr/share/univention-directory-manager-tools/check_group_recursion
> Number of groups: 50
> Traceback (most recent call last):
>   File "/usr/share/univention-directory-manager-tools/check_group_recursion", line 165, in <module>
>     main()
>   File "/usr/share/univention-directory-manager-tools/check_group_recursion", line 147, in main
>     checkChilds(grp_module, grpobjlist[i].dn, [], options.verbose)
>   File "/usr/share/univention-directory-manager-tools/check_group_recursion", line 97, in checkChilds
>     grpobj = univention.admin.objects.get(grp_module, co, lo, position='', dn=dn, arg='')
> TypeError: get() got an unexpected keyword argument 'arg'

Nach Ändern des Aufrufes von get() scheint alles ok zu sein:

> ...get(grp_module, co, lo, position='', dn=dn, attr=None)
Comment 3 Andreas Büsching univentionstaff 2012-03-29 10:04:16 CEST
(In reply to comment #2)
> Nach Ändern des Aufrufes von get() scheint alles ok zu sein:
> 
> > ...get(grp_module, co, lo, position='', dn=dn, attr=None)

Das ist ebenfalls eine API-Änderung. Diese sind hier dokumentiert:

http://wiki.univention.de/index.php?title=UCS_3.0_Univention_Directory_Manager_Modules
Comment 4 Alexander Kläser univentionstaff 2012-03-30 18:25:26 CEST
Das Paket wurde für ucs3.0-2 und errata3.0-1 gebaut, die YAML-Datei wurde erstellt, das 3.0-2-Changelog angepasst.

 univention-directory-manager-modules (7.0.229-1) unstable; urgency=low
 .
   * check_group_recursion: added more error message in case LDAP schema
     extensions are deemed not to be installed; Bug #26104
   * added additional cleanup upon removal of a computer object: service and
     host records as well as aRecords of the corresponding forward zone;
     Bug #26400
Comment 5 Andreas Büsching univentionstaff 2012-04-02 13:05:08 CEST
Ich kann auf UCS 3.0-0 errata 47 mit dem Repo errata3.0-1 von omar den UDM nicht installieren:


root@master:~# apt-get install python-univention-directory-manager-cli python-univention-directory-manager univention-directory-manager-tools
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut       
Statusinformationen werden eingelesen... Fertig
Einige Pakete konnten nicht installiert werden. Das kann bedeuten, dass
Sie eine unmögliche Situation angefordert haben oder, wenn Sie die
Unstable-Distribution verwenden, dass einige erforderliche Pakete noch
nicht erstellt wurden oder Incoming noch nicht verlassen haben.
Die folgenden Informationen helfen Ihnen vielleicht, die Situation zu lösen:

Die folgenden Pakete haben unerfüllte Abhängigkeiten:
 python-univention-directory-manager : Hängt ab von: python-univention (> 6.0.21) aber 6.0.20-1.117.201111221653 soll installiert werden
E: Beschädigte Pakete
Comment 6 Alexander Kläser univentionstaff 2012-04-02 13:43:54 CEST
(In reply to comment #5)
> Ich kann auf UCS 3.0-0 errata 47 mit dem Repo errata3.0-1 von omar den UDM
> nicht installieren:

Stimmt, ich habe den unten stehenden Patch mit reingenommen, um das Problem des Versionskonfliktes beim Errata-Update von aus 3.0-0 zu umgehen.

Index: debian/control
===================================================================
--- debian/control  (Revision 31878)
+++ debian/control  (Arbeitskopie)
@@ -12,7 +12,7 @@
 Package: python-univention-directory-manager
 Architecture: all
 Depends: ${misc:Depends}, ${python:Depends},
- python-univention (>> 6.0.21),
+ python-univention (>> 6.0.20),
  python-univention-heimdal (>= 4.0.1-1),
  makepasswd,
  python-m2crypto,
Comment 7 Andreas Büsching univentionstaff 2012-04-02 13:56:41 CEST
ich kann es jetzt installieren, aber ich kriege beim Öffnen des Rechner-Moduls folgenden Trace:

Traceback (most recent call last):
File '/usr/lib/pymodules/python2.6/univention/management/console/modules/__init__.py', line 97, in execute
func( request )
File '/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py', line 111, in wrapper_func
lo = udm_uldap.access( host = ucr.get( 'ldap/master' ), base = ucr.get( 'ldap/base' ), binddn = _user_dn, bindpw = _password )
File '/usr/lib/pymodules/python2.6/univention/admin/uldap.py', line 254, in __init__
self.lo=univention.uldap.access(host, port, base, binddn, bindpw, start_tls, follow_referral=follow_referral)
TypeError: __init__() got an unexpected keyword argument 'follow_referral'
Comment 8 Alexander Kläser univentionstaff 2012-04-02 14:48:38 CEST
(In reply to comment #7)
> ich kann es jetzt installieren, aber ich kriege beim Öffnen des Rechner-Moduls
> folgenden Trace: ...

Um dieses Problem zu umgehen wurde folgender Workaround in das Patch mit übernommen:

Index: modules/univention/admin/uldap.py
===================================================================
--- modules/univention/admin/uldap.py   (Revision 31878)
+++ modules/univention/admin/uldap.py   (Arbeitskopie)
@@ -251,7 +251,12 @@
            if not port:
                port = int(configRegistry.get('ldap/server/port', 7389))
            try:
-               self.lo=univention.uldap.access(host, port, base, binddn, bindpw, start_tls, follow_referral=follow_referral)
+               # workaround for errata update and API change introduced in Bug #9139
+               try:
+                   self.lo=univention.uldap.access(host, port, base, binddn, bindpw, start_tls, follow_referral=follow_referral)
+               except TypeError as e:
+                   self.lo=univention.uldap.access(host, port, base, binddn, bindpw, start_tls)
+                   
            except ldap.INVALID_CREDENTIALS,ex:
                raise univention.admin.uexceptions.authFail, _( "Authentication failed" )
            except ldap.UNWILLING_TO_PERFORM,ex:
Comment 9 Andreas Büsching univentionstaff 2012-04-02 17:13:30 CEST
Die Funktion wurde unter UCS 3.0-0 und 3.0-1 getestet und funktioniert.
Die YAML-Datei wurde geprüft und die Installation vom externen Repository getestet.
Comment 10 Janek Walkenhorst univentionstaff 2012-11-09 16:33:15 CET
http://errata.univention.de/errata48.html