Problem: ucs@school Import Fails with "unexpected keyword argument 'dry_run'"

ucsschool
import
problem

#1

Problem: ucs@school Import Fails with “unexpected keyword argument ‘dry_run’”

When importing users the dry run does not report any errors. But when running it fails. The logfile notes the following entries:

2018-11-14 13:36:16 INFO  Found hook classes: RemoveCharFromUserAttribHook, UniqueEmailAddressHook
2018-11-14 13:36:16 ERROR Outer Exception catcher: TypeError("__init__() got an unexpected keyword argument 'dry_run'",)
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/frontend/cmdline.py", line 121, in main
    self.do_import()
[...]
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/pyhooks/pyhooks_loader.py", line 126, in get_hook_objects
    pyhook_objs = [pyhook_cls(*args, **kwargs) for pyhook_cls in self.get_hook_classes()]
TypeError: __init__() got an unexpected keyword argument 'dry_run'

Solution

It is a know issue, an update is available and usually gets installed by Univention Professional Service. At your own risk you can implement a fix at your site as follows.

Step 1

Find the file unique_email_Addresses.py:
find /usr/share/ucs-school-import -name unique_email_addresses.py

Step 2

Edit the file and replace lines as follows:
Old:

def __init__(self, lo):
         super(UniqueEmailAddressHook, self).__init__(lo)

Replace by:

def __init__(self, lo=None, dry_run=False, *args, **kwargs):
        super(UniqueEmailAddressHook, self).__init__(lo, dry_run, *args, **kwargs)

Afterwards your import should run.


#2