Hey, I tried to add a custom UDM Syntax via the UMC and command line but it get’s deleted immediately.
Here’s my udm command
udm settings/udm_syntax create \
--position "cn=udm_syntax,cn=univention,$(ucr get ldap/base)" \
--set name="userStatusSyntax" \
--set filename="userstatus.py" \
--set data="QlpoOTFBWSZTWbHOqCkAAEzfgEQQQOUAEipgCAovb99gIACSDU0TQeoZGgAAHqCRTUjTaQHpGhoDI0QllXOwKarq0IklUjLbnP1V5w69lEoi25tttuiJ3ItoEkeyVcCPmyOUF+BjNY6dxezAZ4OOdjfYIGHiIuj4C/IaSqvarMPDhKyCy+QR14NSltIQ2Qnq3W/OtxJYMATBuJDeUFMCBx/i7kinChIWOdUFIA==" \
--set package="User Status Attribute" \
--set packageversion="0.1"
The data is this, bzipped and base64 encoded
from univention.admin.syntax import select
class userStatusSyntax(select):
choices = [
('', ''),
('Idle', 'Idle'),
('Halted', 'Halted'),
('Active', 'Active'),
('Extra', 'Extra'),
('Check', 'Check')
]
default = ''
I’ve also tried it with the UMC but same result.
Any Help appreciated
I tried it another way today like this but it did not work either:
. /usr/share/univention-join/joinscripthelper.lib
. /usr/share/univention-lib/join.sh
. /usr/share/univention-lib/ldap.sh
ucs_registerLDAPExtension \
--packagename "User-Status-Syntax" \
--packageversion "1.0" \
--udm_syntax /usr/lib/python3/dist-packages/univention/admin/syntax.d/userstatus.py
Object exists: cn=udm_syntax,cn=univention,dc=mydomain,dc=tld
Object created: cn=userstatus,cn=udm_syntax,cn=univention,dc=mydomain,dc=tld
Waiting for activation of the extension object userstatus: .........................................................ERROR
ERROR: Primary Directory Node did not mark the extension object active within 180 seconds.
ucs_registerLDAPExtension: registraton of [path to] userstatus.py failed.
I found the final solution:
. /usr/share/univention-join/joinscripthelper.lib
. /usr/share/univention-lib/join.sh
. /usr/share/univention-lib/ldap.sh
bzip2 -c /usr/share/userstatus-tmp-bd/userstatus_template.py | base64 > /usr/share/userstatus-tmp-bd/userstatus.py
ucs_registerLDAPExtension \
--packagename "User-Status-Syntax" \
--packageversion "1.0" \
--ucsversionstart "5.0-0" \
--ucsversionend "5.0-99" \
--udm_syntax /usr/share/userstatus-tmp-bd/userstatus.py \