Bug 1297468 - hammer host update --domain to validate taxonomy first
hammer host update --domain to validate taxonomy first
Status: NEW
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Organizations and Locations (Show other bugs)
x86_64 Linux
medium Severity medium (vote)
: Unspecified
: --
Assigned To: satellite6-bugs
: Triaged
Depends On:
  Show dependency treegraph
Reported: 2016-01-11 10:29 EST by Pavel Moravec
Modified: 2018-06-30 01:36 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Pavel Moravec 2016-01-11 10:29:32 EST
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):

How reproducible:

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"

Actual results:
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.

Expected results:
4. should not pass, further unrelated actions in WebUI or hammer should be possible.

Additional info:
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.
Comment 5 Marek Hulan 2016-12-02 09:38:39 EST
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."

Note You need to log in before you can comment on or make changes to this bug.