Univention Bugzilla – Bug 33703
Setting sambaLogonHours causes a udm traceback
Last modified: 2014-01-31 09:03:54 CET
A customer (Ticket #2013112621003776) set the LDAP attribute sambaLogonHours on the account tab selecting multiple entries. After that, displaying the user using the udm command line is not possible anymore. The following traceback occurs: # udm users/user list --filter username=testuserunivention Traceback (most recent call last): File "/usr/share/univention-directory-manager-tools/univention-cli-server", line 237, in doit output = univention.admincli.admin.doit(arglist) File "/usr/lib/pymodules/python2.6/univention/admincli/admin.py", line 394, in doit out=_doit(arglist) File "/usr/lib/pymodules/python2.6/univention/admincli/admin.py", line 1138, in _doit out.append(' %s: %s' % ( _2utf8( key ), _2utf8( s.tostring( value ) ) ) ) File "/usr/lib/pymodules/python2.6/univention/admincli/admin.py", line 250, in _2utf8 return text.decode( 'iso-8859-1' ) AttributeError: 'list' object has no attribute 'decode'
In one case this even lead to the problem that the UMC didn't display anything on the account tab anymore, just a blank page.
(In reply to Jan Christoph Ebersbach from comment #1) > In one case this even lead to the problem that the UMC didn't display > anything on the account tab anymore, just a blank page. Confirmed: "Just" select all possible checkboxes (took me five minutes...) throw new Error(this.declaredClass + ": Invalid item argument."); Error: dojo.data.ItemFileWriteStore: Invalid item argument. // item was null
Just selecting the first item (Su 0-1) (and nothing else) seems to be the same as selecting none at all
(In reply to Jan Christoph Ebersbach from comment #0) > A customer (Ticket #2013112621003776) set the LDAP attribute sambaLogonHours > on the account tab selecting multiple entries. After that, displaying the > user using the udm command line is not possible anymore. The following > traceback occurs: > > # udm users/user list --filter username=testuserunivention > Traceback (most recent call last): > File > "/usr/share/univention-directory-manager-tools/univention-cli-server", line > 237, in doit > output = univention.admincli.admin.doit(arglist) > File "/usr/lib/pymodules/python2.6/univention/admincli/admin.py", line > 394, in doit > out=_doit(arglist) > File "/usr/lib/pymodules/python2.6/univention/admincli/admin.py", line > 1138, in _doit > out.append(' %s: %s' % ( _2utf8( key ), _2utf8( s.tostring( value ) ) ) > ) > File "/usr/lib/pymodules/python2.6/univention/admincli/admin.py", line > 250, in _2utf8 > return text.decode( 'iso-8859-1' ) > AttributeError: 'list' object has no attribute 'decode' Problem is: if module.property_descriptions[key].multivalue: # False for SambaLogonHours else: # udm-cli does not assume a list here but: logonHoursUnmap (users/user) returns a list - probably for the UMC widget
This is a duplicate of Bug #28664. Also see Bug #28496 for other issues.
*** Bug 28664 has been marked as a duplicate of this bug. ***
(In reply to Dirk Wiesenthal from comment #3) > Just selecting the first item (Su 0-1) (and nothing else) seems to be the > same as selecting none at all Just Su 0-1 is [0] which means: univention/admin/mapping.py def mapValue(self, map_name, value): [...] empty=1 for v in value: if v: empty=0 if empty: return ''
root@master250:~# udm users/user modify --dn uid=klober,cn=users,dc=dwiesent,dc=ucs32,dc=dev --set sambaLogonHours="" Traceback (most recent call last): File "/usr/share/univention-directory-manager-tools/univention-cli-server", line 222, in doit output = univention.admincli.admin.doit(arglist) File "/usr/lib/pymodules/python2.6/univention/admincli/admin.py", line 393, in doit out=_doit(arglist) File "/usr/lib/pymodules/python2.6/univention/admincli/admin.py", line 978, in _doit if object.hasChanged(input.keys()) or object.hasChanged(append.keys()) or object.hasChanged(remove.keys()) or parsed_append_options or parsed_options: File "/usr/lib/pymodules/python2.6/univention/admin/handlers/users/user.py", line 1599, in hasChanged return super(object, self).hasChanged(key) File "/usr/lib/pymodules/python2.6/univention/admin/handlers/__init__.py", line 161, in hasChanged if self.hasChanged(i): File "/usr/lib/pymodules/python2.6/univention/admin/handlers/users/user.py", line 1599, in hasChanged return super(object, self).hasChanged(key) File "/usr/lib/pymodules/python2.6/univention/admin/handlers/__init__.py", line 158, in hasChanged return not univention.admin.mapping.mapCmp(self.mapping, key, self.oldinfo.get(key, ''), self.info.get(key, '')) File "/usr/lib/pymodules/python2.6/univention/admin/mapping.py", line 193, in mapCmp return map[1](old) == map[1](new) File "/usr/lib/pymodules/python2.6/univention/admin/handlers/users/user.py", line 1022, in logonHoursMap bitstring = ''.join( map( lambda x: x in logontimes and '1' or '0', range( 168 ) ) ) File "/usr/lib/pymodules/python2.6/univention/admin/handlers/users/user.py", line 1022, in <lambda> bitstring = ''.join( map( lambda x: x in logontimes and '1' or '0', range( 168 ) ) ) TypeError: 'in <string>' requires string as left operand, not int logontimes is '', because of self.info.get(key, '')
To summarize: cli: (1) Showing sambaLogonHours was nearly always broken (Comment 0) (2) Setting sambaLogonHours was commonly broken (Comment 8) umc-udm: (3) Showing sambaLogonHours was sometimes broken (Comment 1) (4) Setting sambaLogonHours was broken in one case (Comment 3) None of these four issues had something to do with each other. (1) and (4) were fixed by checking key == 'sambaLogonHours' in order to rule out side effects. (2) was fixed in the dedicated mapping function (3) was the only "general bug" - which is only known to show up in UDM's sambaLogonHours, though - and was fixed in the umc-frontend. Fixed in univention-directory-manager-modules 9.0.75-13.1166.201401211304 univention-management-console-frontend 3.0.152-10.807.201401211314 YAMLs updated
(In reply to Dirk Wiesenthal from comment #9) > To summarize: > > cli: > (1) Showing sambaLogonHours was nearly always broken (Comment 0) * OK, it is displayed now. > (2) Setting sambaLogonHours was commonly broken (Comment 8) * OK, i can set an empty value > umc-udm: > (3) Showing sambaLogonHours was sometimes broken (Comment 1) * OK, the detailpage renders correctly now > (4) Setting sambaLogonHours was broken in one case (Comment 3) * OK, setting the first, all, some and unsetting works > YAMLs updated * OK
http://errata.univention.de/ucs/3.2/42.html
http://errata.univention.de/ucs/3.2/45.html