Bug 52930 - AttributeError in validator code
AttributeError in validator code
Status: RESOLVED DUPLICATE of bug 52927
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: 2021-03-17 09:00 CET by Tobias Wenzel
Modified: 2021-03-17 09:25 CET (History)
1 user (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 Tobias Wenzel univentionstaff 2021-03-17 09:00:16 CET
/kelvin/ucs-school-lib # python3
Python 3.8.8 (default, Mar 15 2021, 13:12:20) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ucsschool.lib.models.validator import validate
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/kelvin/ucs-school-lib/modules/ucsschool/lib/models/__init__.py", line 37, in <module>
    from .school import *
  File "/kelvin/ucs-school-lib/modules/ucsschool/lib/models/school.py", line 63, in <module>
    from .base import RoleSupportMixin, UCSSchoolHelperAbstractClass
  File "/kelvin/ucs-school-lib/modules/ucsschool/lib/models/base.py", line 67, in <module>
    from .validator import validate
  File "/kelvin/ucs-school-lib/modules/ucsschool/lib/models/validator.py", line 65, in <module>
    backup_count = int(ucr.get("ucsschool/validation/logging/backupcount").strip() or 60)
AttributeError: 'NoneType' object has no attribute 'strip'


If the ucr-v ucsschool/validation/logging/backupcount is not set, this will raise an error.
Comment 1 Tobias Wenzel univentionstaff 2021-03-17 09:11:11 CET
Fixed with 

[twenzel/4.4/52930_attribute_error] b949561c5 Bug #52930: fix attribute error

[twenzel/kelvin/52930_attribute_error] 89a0c3044 Bug 52930: fix attribute error


→ import works as expected & and tests pass
Comment 2 Daniel Tröder univentionstaff 2021-03-17 09:25:41 CET

*** This bug has been marked as a duplicate of bug 52927 ***