decoit / asterisk4ucs

Asterisk-Extension for Univention Server
http://www.asterisk4ucs.de
3 stars 2 forks source link

PhoneGroup can not be saved #12

Closed britter-decoit closed 7 years ago

britter-decoit commented 7 years ago

PhoneGroup cannot be saved:

Die Ausführung des Kommandos udm/add asterisk/asterisk ist fehlgeschlagen:

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/notifier/threads.py", line 82, in _run
    tmp = self._function()
  File "/usr/lib/pymodules/python2.7/notifier/__init__.py", line 104, in __call__
    return self._function( *tmp, **self._kwargs )
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/udm/__init__.py", line 367, in _thread
    dn = module.create(properties, container=options.get('container'), superordinate=options.get('superordinate'))
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/udm/udm_ldap.py", line 86, in _decorated
    return method(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/univention/management/console/ldap.py", line 141, in _decorated
    result = func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/udm/udm_ldap.py", line 373, in create
    obj = self.module.object(None, ldap_connection, ldap_position, superordinate=superordinate)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/asterisk/phoneGroup.py", line 90, in __init__
    super(object, self).__init__(self, co, lo, position, dn, superordinate)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/asterisk/__init__.py", line 585, in __init__
    self.openSuperordinate()
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/asterisk/__init__.py", line 622, in openSuperordinate
    serverdn = self.oldattr.get("ast4ucsSrvchildServer") or self.lo.getAttr(self.dn, "ast4ucsSrvchildServer")
AttributeError: 'NoneType' object has no attribute 'getAttr'

This is version 1.0.9 in the app center.

spaceone commented 7 years ago

I have a question: Is a asterisk/contact-object always underneath the subtree of its asterisk/phoneBook ?

britter-decoit commented 7 years ago

I checked with the caller2name resolution agi and it does not require a certain phonebook. But logically I would assume an contact to be always a member of a phonebook.

In contact.py the superordinate is fixed set: https://github.com/decoit/asterisk4ucs/blob/ucs4.1/asterisk4ucs-udm/modules/univention/admin/handlers/asterisk/contact.py#L35

But what is the link between PhoneGroup and this error?

spaceone commented 7 years ago

@britter-decoit I am searching for a way to replace the logic in the asterisk handlers completely and let all this be handled by the UDM core. That's the link :) It looks very strange that self.lo is None.

spaceone commented 7 years ago

@britter-decoit I installed asterisk with UCS 4.1-3 and the old version in appcenter and saw that the UMC module was prior displayed via the tree view. This is with the new version not the case. I think we need to fix something in UCS for this, too.

spaceone commented 7 years ago

I created https://forge.univention.org/bugzilla/show_bug.cgi?id=43423.