Red Hat Bugzilla – Bug 1297468
hammer host update --domain to validate taxonomy first
Last modified: 2018-03-16 16:00:55 EDT
Description of problem:
When updating a host via hammer, it should validate if the new attribute belongs to the same taxonomy (organization/location). Example:
Host A in Location Loc1 that is associated with Domain D1 (only). Via hammer, I am able to change the Host's domain to D2 without a problem.
This creates issues when trying to update the host later on - such updates fail due to invalid domain/puppet environment/operating system details/.. .
Please add either warning when selecting a domain/puppet environment outside the taxonomy, or rather dont allow it at all.
(not sure if this is hammer or foreman bug. Since the change is not allowed in WebUI, hammer is in suspicion more than foreman)
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Have 2 domains d1.example.com and d2.example.com
2. Have a location Loc1 associated with d1.example.com only
3. Have a Host in Loc1 with domain d1
4. hammer -u admin -p password host update --domain "d2.example.com" --name "myhost.d1.example.com"
4. passes and the host has a domain not listed in it's Location.
Any attempt to update the host via WebUI fails due to domain mismatch.
4. should not pass, further unrelated actions in WebUI or hammer should be possible.
Note again the example above is just one specific scenario with domains. The bugzilla is meant to be more generic - any change of a parameter associated with taxonomy must be verified wrt. the taxonomy before committing it.
Still reproducible with Sat 6.2.5 and latest upstream. This is not specific to domains but all taxable resources therefore I'm moving to Organizations and Locations component. We need some more generic solution, maybe we could use parameter filters layer that was introduced with strong params.
If this happens, there's a way to find all such mismatches. Navigate to edit page of organization of the host in WEB UI, you should see resources that needs to be assigned to this organization marked by red color with error message "you cannot remove domains that are used by hosts or inherited."