Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
host remove
a bit safer to use. (#211)
## The problem... It was much too easy to do `host remove foo -f` and have it bite in the worst possible way. ## The solution? In this PR, `-force` is no longer a catch-all for making `host remove`, well, remove the host. If the host has cnames, ptrs, mx, srvs or ipadresses across multiple vlans, the user needs to declare a desire to override each of these explicitly via the new option `-override`. ## Supported input Accepted overrides are `cname`, `ipadress`, `mx`, `srv`, `ptr`, `naptr`. Invalid overrides offered as parameters to `-override` are errors and the command will report on the unexpected input and stop before executing anything. The choice to have these as textual inputs is intended with the explicit goal of making their use require more than tab-completing an option. ## Example usage `host remove foo -force -override cname,ipaddress,mx`. This would allow deletion / removal of a host with cnames, ipadresses across different vlans, and mx set. However, any ptr or srv RRs will still cause the deletion to cancel. ## Example warning from `host remove` ``` WARNING: : bar.example.org requires force and cnames as overrides for deletion: 1 cnames, override with 'cname' - fubar.example.org multiple ipaddresses on the same VLAN. Must use 'force'." ``` ## Notes: 1. `-force` alone works on multiple ipadresses from the same VLAN. 2. `-override` requires the presence of `-force`. The documentation states this both from expanded inline help and `host remove -h`. --------- Co-authored-by: pederhan <[email protected]>
- Loading branch information