Project

General

Profile

Bug #24559

Hostgroups should use AssociationExistsValidator for content_source

Added by Andrew Kofink almost 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Difficulty:
trivial
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

$ hammer hostgroup create --name potato --content-source-id 92 # does not exist
Could not create the hostgroup:
  PG::ForeignKeyViolation: ERROR:  insert or update on table "hostgroups" violates foreign key constraint "hostgroups_content_source_id_fk" 
  DETAIL:  Key (content_source_id)=(92) is not present in table "smart_proxies".
  : INSERT INTO "hostgroups" ("name", "created_at", "updated_at", "title", "content_source_id", "lookup_value_matcher") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" 

This isn't specific to hammer.


Related issues

Related to Katello - Bug #21689: Specifying wrong foreign key id for object (such as host or hostgroup) via hammer/api throws SQL errorClosed2017-11-16
Related to Katello - Bug #24528: Content Source resource_name is smart_proxy, which is confusing to usersClosed

Associated revisions

Revision e8f2e13b (diff)
Added by Andrew Kofink almost 2 years ago

Fixes #24559: validate hostgrp content_source_id

History

#1 Updated by Andrew Kofink almost 2 years ago

  • Related to Bug #21689: Specifying wrong foreign key id for object (such as host or hostgroup) via hammer/api throws SQL error added

#2 Updated by Andrew Kofink almost 2 years ago

  • Related to Bug #24528: Content Source resource_name is smart_proxy, which is confusing to users added

#3 Updated by The Foreman Bot almost 2 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/7608 added

#4 Updated by Justin Sherrill almost 2 years ago

  • Triaged changed from No to Yes

#5 Updated by Andrew Kofink almost 2 years ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF