Actions
Bug #8358
closedNo validation of domain in host
Description
When updating a host, there is no validation whether the domain exists [if it does not exist, it is ignored - instead of throwing domain does not exist]
Steps to reproduce:
Via Hammer:
hammer -d host update --name <<server.fqdn>> --domain-id 1935 hammer -d host update --name <<server.fqdn>> --domain-id shlomizadok
both return Host updated.
Via Api:
Started PUT "/api/v2/hosts/smartproxy.local.lan" for 127.0.0.1 at 2014-11-12 09:25:35 +0200 Processing by Api::V2::HostsController#update as JSON Parameters: {"host"=>{"domain_id"=>"shlomi"}, "apiv"=>"v2", "id"=>"smartproxy.local.lan"} ... Completed 200 OK in 368.9ms
Expected result:
Return an error "Could not update host"
Example:
hammer -d host update --name smartproxy.local.lan --medium-id 232134
Returns:
DETAIL: Key (medium_id)=(232134) is not present in table "media". Could not update the host: ERROR: insert or update on table "hosts" violates foreign key constraint "hosts_medium_id_fk" DETAIL: Key (medium_id)=(232134) is not present in table "media".
Updated by The Foreman Bot over 9 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/2084 added
- Pull request deleted (
)
Updated by Marek Hulán over 9 years ago
- Translation missing: en.field_release set to 28
I guess as a bug this goes 1.8
Updated by Shlomi Zadok over 9 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset cbe1391f48f37d4bf9a53091c668b6a91bc6ef83.
Actions