Bug 42412 - ucs-school-import output is user unfriendly
ucs-school-import output is user unfriendly
Status: RESOLVED DUPLICATE of bug 41651
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 4.1 R2
Other Linux
: P5 normal (vote)
: ---
Assigned To: Bugzilla Mailingliste
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-09-15 15:39 CEST by Florian Best
Modified: 2016-09-15 15:42 CEST (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): Cleanup, Design, Error handling, Usability
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 2016-09-15 15:39:39 CEST
1. The default is that verbose is enabled. You have to manually set --set verbose=false - which doesn't even have the effect that it is not verbose as there is still a lot of things written into stdout (see 3.).

2. Tracebacks are printed to stdout

Entry #0: ValidationError when adding ImportStudent(name='A.Meyer4', school='gsmitte', dn='uid=A.Meyer4,cn=schueler,cn=users,ou=gsmitte,dc=school,dc=local', old_dn=None) (source_uid:NewDB record_uid: anton1@nstx.local): {'school': ['The school "schule1" does not exist. Please choose an existing one or create it.']}
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/mass_import/user_import.py", line 131, in create_and_modify_users
    success = user.create(lo=self.connection)
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/models/import_user.py", line 150, in create
    return super(ImportUser, self).create(lo, validate)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 417, in create
    success = self.create_without_hooks(lo, validate)
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/models/import_user.py", line 153, in create_without_hooks
    success = super(ImportUser, self).create_without_hooks(lo, validate)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 443, in create_without_hooks
    self.do_create(udm_obj, lo)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/user.py", line 229, in do_create
    udm_obj['groups'] = self.groups_used(lo)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/user.py", line 461, in groups_used
    self.get_or_create_group_udm_object(group_dn, lo)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/user.py", line 475, in get_or_create_group_udm_object
    group.create(lo)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 417, in create
    success = self.create_without_hooks(lo, validate)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 430, in create_without_hooks
    raise ValidationError(self.errors.copy())
UserValidationError: ValidationError when adding ImportStudent(name='A.Meyer4', school='gsmitte', dn='uid=A.Meyer4,cn=schueler,cn=users,ou=gsmitte,dc=school,dc=local', old_dn=None) (source_uid:NewDB record_uid: anton1@nstx.local): {'school': ['The school "schule1" does not exist. Please choose an existing one or create it.']}

3. There are many programmatic output messages:
Using command line arguments: {'input': {'filename': 'new-format-userimport.csv'}, 'verbose': False, 'user_role': 'student'}

Configuration is:
{u'activate_new_users': {u'default': True},
 u'classes': {},
… 20 more lines …

Adding ImportStudent(name='A.Meyer4', school='gsmitte', dn='uid=A.Meyer4,cn=schueler,cn=users,ou=gsmitte,dc=school,dc=local', old_dn=None) (source_uid:NewDB record_uid:anton1@nstx.local) attributes={'$dn$': 'uid=A.Meyer4,cn=schueler,cn=users,ou=gsmitte,dc=school,dc=local',
 'display_name': 'Anton Meyer', 'record_uid': u'anton1@nstx.local', 'firstname': 'Anton', 'lastname': 'Meyer', 'type_name': 'Student', 'school': 'gsmitte', 'name': 'A.Meyer4', 'disabled': 'none', 'email': u'anton1@nstx.local', 'birthday': None, 'type': 'importStudent', 'sc
hools': ['gsmitte', 'schule1'], 'password': '%8x2MFR+s@Z:$(q', 'source_uid': u'NewDB', 'school_classes': {'gsmitte': ['gsmitte-1A']}, 'objectType': 'users/user'} udm_properties={u'phone': [u''], u'rid': u'anton1@nstx.local', 'overridePWHistory': '1', u'description': u'Dies
 ist ein Sch\xfcler', 'overridePWLength': '1'}...
Comment 1 Daniel Tröder univentionstaff 2016-09-15 15:42:09 CEST

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