unioslo / mreg-cli

Command Line Interface for Mreg
GNU General Public License v3.0
2 stars 7 forks source link

ttl_set reports "OK: : updated TTL" on cnames where nothing is done #247

Open vidarsk opened 5 months ago

vidarsk commented 5 months ago

When using ttl_set on a cname, it gives misleading output:

mreg> host ttl_set www.sv.c-rex.uio.no 600
OK: : updated TTL to 600 for www.sv.c-rex.uio.no
mreg> host info www.sv.c-rex.uio.no
www.sv.c-rex.uio.no is a CNAME for itfds-crexshinyprod.uio.no
...
TTL:          (Default)

I would expect the command to give an error message in this case.

terjekv commented 5 months ago

This behaviour is changed during the migration to pydantic (https://github.com/unioslo/mreg-cli/pull/214). In this branch the CNAME will be resolved as follows:

mreg-test.uio.no> host info login.math.uio.no
login.math.uio.no is a CNAME for europa.uio.no
Name:         europa.uio.no
[...]
mreg-test.uio.no> host ttl_set login.math.uio.no 600
OK: : Set TTL for europa.uio.no to 600.
login.math.uio.no is a CNAME for europa.uio.no