Bug 49828 - Python api for school computers doesn't support ip changes through list methods
Python api for school computers doesn't support ip changes through list methods
Status: NEW
Product: UCS@school
Classification: Unclassified
Component: Ucsschool-lib
UCS@school 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS@school maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-07-10 10:36 CEST by Jürn Brodersen
Modified: 2019-07-15 16:17 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.069
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 Jürn Brodersen univentionstaff 2019-07-10 10:36:38 CEST
Python api for school computers doesn't support ip changes through list methods

The python school lib doesn't support editing ip address by using list methods, like append and pop, and the ip_address attribute. Just using the methods works but the modify method ignores the changes.

The problem seems to be a pointer to the ip attribute of the underlying udm object.
"obj.ip_address = udm_obj['ip']"
I think this might be done for the "nextIP magic" in "def _alter_udm_obj"?

modify_without_hooks (in base.py) later uses the "info" attribute from the underlying udm object to detect changes: "old_attrs = deepcopy(udm_obj.info)".
But due to the pointer, that is already in the same state as the school computer object.
I 'm not sure why "info" and not "oldinfo" was used here?