[UDM] Computer create - Property overwriting (dhcpEntryZone & dhcpEntryZone)

Version

UCS: 5.0-1 errata203 (from Univention VirtualBox VM image)

Description

Only the last value set for a property is saved (overwriting), for properties dnsEntryZoneForward and dhcpEntryZone.

Command

Object creation:

udm computers/windows create --position cn=computers,dc=test,dc=lan --set name=TEST --set ip=192.168.1.1 --set ip=192.168.1.2 --set mac=00:00:01:00:00:01 --set mac=00:00:01:00:00:02 --set ‘dnsEntryZoneForward=zoneName=test.lan,cn=dns,dc=test,dc=lan 192.168.1.1’ --set ‘dnsEntryZoneForward=zoneName=test.lan,cn=dns,dc=test,dc=lan 192.168.1.2’ --set ‘dhcpEntryZone=cn=test.lan,cn=dhcp,dc=test,dc=lan 192.168.1.1 00:00:01:00:00:01’ --set ‘dhcpEntryZone=cn=test.lan,cn=dhcp,dc=test,dc=lan 192.168.1.2 00:00:01:00:00:02’

This command creates a computer object, and sets the value for property dnsEntryZoneForward to zoneName=test.lan,cn=dns,dc=test,dc=lan 192.168.1.2 only, overwriting the value zoneName=test.lan,cn=dns,dc=test,dc=lan 192.168.1.1.

It should sets the property two times, one for each value, without any overwriting.

Same behavior for property dhcpEntryZone.

Result

root@ucs:~# udm computers/windows list

DN: cn=TEST,cn=computers,dc=test,dc=lan
description: None
dhcpEntryZone: cn=test.lan,cn=dhcp,dc=test,dc=lan 192.168.1.2 00:00:01:00:00:02
dnsEntryZoneForward: zoneName=test.lan,cn=dns,dc=test,dc=lan 192.168.1.2
domain: test.lan
fqdn: TEST.test.lan
groups: cn=Windows Hosts,cn=groups,dc=test,dc=lan
ip: 192.168.1.2
ip: 192.168.1.1
mac: 00:00:01:00:00:01
mac: 00:00:01:00:00:02
name: TEST
network: None
networkAccess: 0
ntCompatibility: None
operatingSystem: None
operatingSystemVersion: None
password: None
primaryGroup: cn=Windows Hosts,cn=groups,dc=test,dc=lan
sambaRID: 1112
shell: /bin/false
unixhome: /dev/null

Expected behavior

root@ucs:~# udm computers/windows list

DN: cn=TEST,cn=computers,dc=test,dc=lan
description: None
dhcpEntryZone: cn=test.lan,cn=dhcp,dc=test,dc=lan 192.168.1.1 00:00:01:00:00:01
dhcpEntryZone: cn=test.lan,cn=dhcp,dc=test,dc=lan 192.168.1.2 00:00:01:00:00:02
dnsEntryZoneForward: zoneName=test.lan,cn=dns,dc=test,dc=lan 192.168.1.1
dnsEntryZoneForward: zoneName=test.lan,cn=dns,dc=test,dc=lan 192.168.1.2
domain: test.lan
fqdn: TEST.test.lan
groups: cn=Windows Hosts,cn=groups,dc=test,dc=lan
ip: 192.168.1.2
ip: 192.168.1.1
mac: 00:00:01:00:00:01
mac: 00:00:01:00:00:02
name: TEST
network: None
networkAccess: 0
ntCompatibility: None
operatingSystem: None
operatingSystemVersion: None
password: None
primaryGroup: cn=Windows Hosts,cn=groups,dc=test,dc=lan
sambaRID: 1112
shell: /bin/false
unixhome: /dev/null

Note

The issue does not appear when using the web interface.

Thank you :slight_smile:

Ok so I found that I have to divide this command into two commands: One for creating the computer object; another one with the --append option.

So, it looks like this:

udm computers/windows create --position cn=computers,dc=test,dc=lan --set name=TEST --set ip=192.168.1.1 --set mac=00:00:01:00:00:01 --set ‘dnsEntryZoneForward=zoneName=test.lan,cn=dns,dc=test,dc=lan 192.168.1.1’ --set ‘dhcpEntryZone=cn=test.lan,cn=dhcp,dc=test,dc=lan 192.168.1.1 00:00:01:00:00:01’

udm computers/windows modify --dn cn=TEST,cn=computers,dc=test,dc=lan --append ip=192.168.1.2 --append mac=00:00:01:00:00:02 --append ‘dnsEntryZoneForward=zoneName=test.lan,cn=dns,dc=test,dc=lan 192.168.1.2’ --append ‘dhcpEntryZone=cn=test.lan,cn=dhcp,dc=test,dc=lan 192.168.1.2 00:00:01:00:00:02’