Bug 52626 - Migrate ucs-school-radius-802.1x to Python 3
Migrate ucs-school-radius-802.1x to Python 3
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: General
UCS@school 5.0
Other Linux
: P5 normal (vote)
: UCS@school 5.0 v1
Assigned To: Florian Best
Felix Botner
: interim-3
Depends on:
Blocks: 52578
  Show dependency treegraph
 
Reported: 2021-01-12 15:24 CET by Florian Best
Modified: 2021-11-29 17:20 CET (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
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 Florian Best univentionstaff 2021-01-12 15:24:10 CET
The package ucs-school-radius-802.1x needs to be migrated to Python 3.

See: https://hutten.knut.univention.de/mediawiki/index.php/Python_3_Migration
Comment 1 Florian Best univentionstaff 2021-06-17 12:27:30 CEST
The current tests are failing due to this because univention-radius is already running with Python 3 in UCS 5.0.

Traceback (most recent call last):
  File "/usr/bin/univention-radius-check-access", line 62, in <module>
    sys.exit(main())
  File "/usr/bin/univention-radius-check-access", line 51, in main
    networkAccess.getNTPasswordHash()
  File "/usr/lib/python3/dist-packages/univention/radius/networkaccess.py", line 222, in getNTPasswordHash
    if not (self.check_proxy_filter_policy() or self.check_network_access()):
  File "/usr/lib/python3/dist-packages/univention/radius/school_networkaccess.py", line 77, in check_proxy_filter_policy
    access = self.evaluate_proxy_network_access(self.username)
  File "/usr/lib/python3/dist-packages/univention/radius/school_networkaccess.py", line 89, in evaluate_proxy_network_access
    matching_groups = {group: info for group, info in self.group_info.iteritems() if group in groups}
AttributeError: 'dict' object has no attribute 'iteritems'

Fixed in:

ucs-school-radius-802.1x (8.0.1)
b9e9a6c87a31 | Bug #52626: migrate ucs-school-radius-802.1x to Python 3
Comment 3 Felix Botner univentionstaff 2021-08-20 15:53:08 CEST
OK is python3 (radius/school_networkaccess.py)

don't how to test this with radiusm checked with:
from univention.radius.school_networkaccess import SchoolNetworkAccess
a = SchoolNetworkAccess('Administrator', 'aa', 4)
a.evaluate_proxy_network_access(username)

OK deny
python3 /tmp/a username=Administrator
     DEBUG: [user=Administrator; mac=aa] Given username: "Administrator"
     DEBUG: [user=Administrator; mac=aa] Given stationId: "aa"
     DEBUG: [user=Administrator; mac=aa] Loading proxy rules from UCR
     DEBUG: [user=Administrator; mac=aa] Loaded user_to_group {'s1': ['Domain Users school1', 'school1-1a', 'schueler-school1'], 's2': ['Domain Users school1', 'school1-1a', 'schueler-school1']}
     DEBUG: [user=Administrator; mac=aa] Loaded group_info {}
     DEBUG: [user=Administrator; mac=aa] DENY: No proxy rules for user Administrator found

OK deny
-> python3 /tmp/a username=s1
     DEBUG: [user=Administrator; mac=aa] Given username: "Administrator"
     DEBUG: [user=Administrator; mac=aa] Given stationId: "aa"
     DEBUG: [user=Administrator; mac=aa] Loading proxy rules from UCR
     DEBUG: [user=Administrator; mac=aa] Loaded user_to_group {'s1': ['Domain Users school1', 'school1-1a', 'schueler-school1'], 's2': ['Domain Users school1', 'school1-1a', 'schueler-school1']}
     DEBUG: [user=Administrator; mac=aa] Loaded group_info {}
     DEBUG: [user=Administrator; mac=aa] DENY: user s1 not found in any WLAN enabled group
     DEBUG: [user=Administrator; mac=aa] DENY: user s1 groups=['Domain Users school1', 'school1-1a', 'schueler-school1']
     DEBUG: [user=Administrator; mac=aa] DENY: WLAN enabled groups=[]

OK allow
-> ucr set proxy/filter/groupdefault/'Domain Users school1'='Domain Users school1'
-> ucr set proxy/filter/setting/'Domain Users school1'/wlan=true
-> python3 /tmp/a username=s1
     DEBUG: [user=Administrator; mac=aa] Given username: "Administrator"
     DEBUG: [user=Administrator; mac=aa] Given stationId: "aa"
     DEBUG: [user=Administrator; mac=aa] Loading proxy rules from UCR
FB->Domain Users school1
     DEBUG: [user=Administrator; mac=aa] Loaded user_to_group {'s1': ['Domain Users school1', 'school1-1a', 'schueler-school1'], 's2': ['Domain Users school1', 'school1-1a', 'schueler-school1']}
     DEBUG: [user=Administrator; mac=aa] Loaded group_info {'Domain Users school1': (0, True)}
     DEBUG: [user=Administrator; mac=aa] ALLOW: WLAN is enabled in a group with highest priority (maxPriorityGroups={'Domain Users school1': (0, True)})
Comment 4 Jürn Brodersen univentionstaff 2021-11-29 17:20:17 CET
UCS@school 5.0 v1 has been released.

https://docs.software-univention.de/release-notes-ucsschool-5.0v1-de.html

If this error occurs again, please clone this bug.