Univention Bugzilla – Bug 35341
changing a room settings affect ucr variables, causing other room settings (behavior, not displayed values) to be changed.
Last modified: 2014-12-01 12:07:15 CET
if two computerrooms exist: room1 <201.132.40.69> room2 <104.231.177.78> Changing room2 settings affects the ucr variables related, and thus the behavior of the settings in room1 changes accordingly. Meanwhile the displayed values (computerroom/settings/get) remains the same correct ones. Example: Settign room1 to be: room1 (InternetRule,PrintMode,ShareMode) = ( 'none' , 'none' , 'home' ) ~#ucr search printmode; echo; cat /etc/samba/local.config.d/printer.* cups/printmode/hosts/none: 201.132.40.69 samba/printmode/hosts/none: 201.132.40.69 samba/printmode/room/boyw8e4d1v: none [5fabc8mxgm] hosts deny = 201.132.40.69 [8it2rkfy92] hosts deny = 201.132.40.69 [PDFDrucker] hosts deny = 201.132.40.69 [fo5c693c2u] hosts deny = 201.132.40.69 [r7gcrwnlgf] hosts deny = 201.132.40.69 Then setting room2 to be: room2 (InternetRule,PrintMode,ShareMode) = ('none', 'default', 'home') ~#ucr search printmode; echo; cat /etc/samba/local.config.d/printer.* cups/printmode/hosts/none: 201.132.40.69 samba/printmode/hosts/none: "" samba/printmode/room/boyw8e4d1v: none [5fabc8mxgm] hosts deny = "" [8it2rkfy92] hosts deny = "" [PDFDrucker] hosts deny = "" [fo5c693c2u] hosts deny = "" [r7gcrwnlgf] hosts deny = ""
The following patch fixed the problem within the test environment. It has to be checked if the hotfix has any sideeffects. --- a/ucs-school-3.2r2/ucs-school-umc-computerroom/umc/python/computerroom/__init__.py +++ b/ucs-school-3.2r2/ucs-school-umc-computerroom/umc/python/computerroom/__init__.py @@ -770,7 +770,9 @@ class Instance(SchoolBaseModule): # are unable to print on samba shares. Solution: set empty value for .../none if no host is on deny list. varname = 'samba/printmode/hosts/none' if not varname in vset: - vset[varname] = '""' + ucr.load() + if not ucr.get('varname'): + vset[varname] = '""' else: # remove empty items ('""') in list vset[varname] = ' '.join([x for x in vset[varname].split(' ') if not x == '""'])
fixed by using a fixed version of that patch from comment 1. "ucr search printmode; echo; cat /etc/samba/local.config.d/printer.* " now shows the correctly merged values.
(In reply to Florian Best from comment #2) > fixed by using a fixed version of that patch from comment 1. > > "ucr search printmode; echo; cat /etc/samba/local.config.d/printer.* " now > shows the correctly merged values. Is seems to be more complicated. Please have a look at https://forge.univention.org/bugzilla/show_bug.cgi?id=30450#c3: There are situations where the merging does not work. Tested with 2 rooms with 2 hosts each. Test 1) in both rooms is printing explicitly enabled samba/printmode/hosts/all: 192.168.0.58 10.200.18.201 10.200.18.13 10.200.18.202 samba/printmode/hosts/none: "" samba/printmode/room/DerRaum: all samba/printmode/room/EinRaum: all → OK Test 2) switch from Test 1) to first room "enabled" and second room "default": samba/printmode/hosts/all: 192.168.0.58 10.200.18.13 samba/printmode/hosts/none: "" samba/printmode/room/DerRaum: all → OK Test 3) switch from Test 2) to first room "enabled" and second room "disabled": samba/printmode/hosts/all: 192.168.0.58 10.200.18.13 samba/printmode/hosts/none: 10.200.18.201 10.200.18.202 samba/printmode/room/DerRaum: all samba/printmode/room/EinRaum: none → OK Test 4) switch from Test 3) to first room "enabled" and second room "default": samba/printmode/hosts/all: 192.168.0.58 10.200.18.13 samba/printmode/room/DerRaum: all → FAIL → should show same result as in Test 2) → 'samba/printmode/hosts/none: ""' is missing Test 5) switch from Test 4) to both rooms "default": → no UCR variables set → OK Test 6) switch from Test 5) to first room "disabled" and second room "default": samba/printmode/hosts/none: 192.168.0.58 10.200.18.13 samba/printmode/room/DerRaum: none → FAIL → 'samba/printmode/hosts/all: ""' is missing Test 7) switch from Test 6) to first room "disabled" and second room "disabled": samba/printmode/hosts/none: 192.168.0.58 10.200.18.201 10.200.18.13 10.200.18.202 samba/printmode/room/DerRaum: none samba/printmode/room/EinRaum: none → FAIL → 'samba/printmode/hosts/all: ""' is missing Test 8) switch from Test 7) to first room "disabled" and second room "default": samba/printmode/hosts/none: 192.168.0.58 10.200.18.13 samba/printmode/room/DerRaum: none → FAIL → same result as in Test 6) → 'samba/printmode/hosts/all: ""' is missing Test 9) switch from Test 8) to first room "disabled" and second room "enabled": samba/printmode/hosts/all: 10.200.18.201 10.200.18.202 samba/printmode/hosts/none: 192.168.0.58 10.200.18.13 samba/printmode/room/DerRaum: none samba/printmode/room/EinRaum: all → OK Added ucs-test script 22_computerroom_test_printmode_ucr_variables
(In reply to Sönke Schwardt-Krummrich from comment #3) > Added ucs-test script 22_computerroom_test_printmode_ucr_variables samba/printmode/hosts/all does not have to be set if only …/hosts/none is set. So all results from above are correct. I changed the test script accordingly and added tests for 3 rooms testing all possible combinations. → back to RESOLVED
OK: Changelog OK: code change OK: functionality
UCS@school 3.2 R2 v2 has been released: http://docs.univention.de/release-notes-ucsschool-3.2R2v2-de.html If this error occurs again, please use "Clone This Bug".