Updating a Host definition using omapi ?

Richard Offer offer at fastscale.com
Sun Jan 14 03:05:11 UTC 2007



I'm writing some software to control an instance of the DHCP server, in
particular to add/update and remove hosts.

No problems with adding, but I can't seem to update a host. I've tried with
the C library and get the same error (already exists) as omshell shows
below.

> [ offer 2.6.9 ] ./omshell
> key fastscale <secure key goes here>
> port 21308
> server 127.0.0.1
> connect
obj: <null>
> new host
obj: host
> set name = "dummy"
obj: host
name = "dummy"
> open
obj: host
name = "dummy"
hardware-address = aa:bb:cc:dd:ee:ff
hardware-type = 00:00:00:01
> set hardware-address = bb:aa:bb:aa:bb:aa
obj: host
name = "dummy"
hardware-address = bb:aa:bb:aa:bb:aa
hardware-type = 00:00:00:01
> update
can't update object: already exists
obj: host
name = "dummy"
hardware-address = bb:aa:bb:aa:bb:aa
hardware-type = 00:00:00:01



Is the only way around this to delete and re-create the host object ? The
docs seem to imply it should work (for example the code in
doc/api+protocol).


Thanks



Richard.


PS. This is with version 3.0.3.




More information about the dhcp-users mailing list