Katello/katello — pull request #4212 by parthaa (2014-06-03 22:01:49+00:00)
Title: Fixes #6050 - Better error message on filter rules create

Basically cli did this on filter rule create with no filter rule params
specified.

$ hammer content-view filter rule create --content-view-id=4
--organization-id=1 --content-view-filter-id 1

Could not create the filter rule:
Error: 400 Bad Request

This commit fixes that by giving more context on what needs to be
specified. This is slightly tricky because depending on errata or
package filters the "base" field requirement is bound to change. Here
are the 2 scenarios this fix now handles..
1) On a package filter specifying package rule it raises name cant be
blank.

$ hammer content-view filter rule create --content-view-id=4
--organization-id=1 --content-view-filter-id 1

Could not create the filter rule:
Validation failed: Name can't be blank

2) On an erratum filter specifying erratum rule it raises something else

$ hammer content-view filter rule create --content-view-id=4
--organization-id=1 --content-view-filter-id 2
Could not create the filter rule:
Validation failed: Invalid erratum filter rule specified, Must specify
at least one of the following: 'errata_id', 'start_date', 'end_date' or
'types'