Udm remove prevent warning if dn not exists

Hi at all,

I have scripts running via cron that remove members from an AD group on a daily basis. If the named members are not present in the group, a warning is generated. OK. But warnings are issued on stderr since UCS 5.

Cronjobs write stdout into a log file. stderr is sent from the cronjob via email, so that I can intervene in case of errors. Due to the changed behavior, I get an email from every cronjob that generates warnings since the update to UCS 5.

root@sv001:~# univention-directory-manager groups/group modify --dn "cn=L-custWsLocalAdmin,ou=SecurityGroups,ou=Groups,ou=cust,dc=intra,dc=cust-loc,dc=de" --remove users="uid=user1,ou=employees,ou=users,ou=cust,dc=intra,dc=cust-loc,dc=de" --remove users="uid=user2,ou=employees,ou=users,ou=cust,dc=intra,dc=cust-loc,dc=de"
WARNING: cannot remove uid=user1,ou=employees,ou=users,ou=cust,dc=intra,dc=cust-loc,dc=de from users, value does not exist
WARNING: cannot remove uid=user2,ou=employees,ou=users,ou=cust,dc=intra,dc=cust-loc,dc=de from users, value does not exist
No modification: cn=L-custWsLocalAdmin,ou=SecurityGroups,ou=Groups,ou=cust,dc=intra,dc=cust-loc,dc=de

Why are univention-directory-manager warnings issued on stderr since UCS 5?

I’ve tested to change the script to reset the group via --set and --append. But this also generates a warning, because the there are always two users in the group. If I use --set and --append in one line and the to be appended dn is already in the group there is a warning generated. And warnings go to stderr. :exploding_head:

root@sv001:~# univention-directory-manager groups/group modify --dn "cn=L-custWsLocalAdmin,ou=SecurityGroups,ou=Groups,ou=cust,dc=intra,dc=cust-loc,dc=de" --set users="uid=svcAntiVir,ou=TechUsers,ou=Users,ou=cust,dc=intra,dc=cust-loc,dc=de" --append users="uid=svcRemSwInst,ou=TechUsers,ou=Users,ou=cust,dc=intra,dc=cust-loc,dc=de"
WARNING: cannot append uid=svcRemSwInst,ou=TechUsers,ou=Users,ou=cust,dc=intra,dc=cust-loc,dc=de to users, value exists
Object modified: cn=L-custWsLocalAdmin,ou=SecurityGroups,ou=Groups,ou=cust,dc=intra,dc=cust-loc,dc=de

Which paths exists to prevent this warnings? Or do I have to change my scripts in multiliners?