Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1379657

Summary: User should get validation error if user tries to create discovery rule with name >255 characters
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: Discovery PluginAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3.0CC: bbuckingham, dlobatog, jcallaha
Target Milestone: UnspecifiedKeywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Max 255 chars none

Description Sachin Ghai 2016-09-27 10:58:58 UTC
Description of problem:
In automation, a test case is failed where we are creating discovery rule >255 characters. Earlier the validation was set but looks like we can create rule with any name length.


]# hammer -u admin -p changeme discovery_rule  create --name 'yXFdwjBlopAVqRsOCgsCRRcnkQFbSDlTeaXVdNYxuRFqIHWcKfDhrgxlEfHVZGVKyEQMLmtyVonBcNLzCtIWqgvLvKxdEpZpwCTDMNFJuOQKZWcYtlzWGkOqUCfLfIEBtljlKZdkebrLDdfPQijuJsQtvrRbyFMrEdcXAeuOhEdBoJHZNNdQALIdpTzsFQqLOHHSyClnVwdwWpufuFJfJtAHlvrglersGWORgKvIdpfKnJwcTUBrKfbxAkcgpbRm' --hostgroup test --search='cpu_count = 1' --organization-ids 1
Rule created




Version-Release number of selected component (if applicable):
Sat6.3 snap2

How reproducible:


Steps to Reproduce:
1. create discovery rule with >255 chars in name
2.
3.

Actual results:
Validation  error should be raised if user tries to create rule with more that 255 chars

Expected results:


Additional info:

Comment 3 Lukas Zapletal 2017-05-24 08:08:11 UTC
Fixed in 6.3:

hammer-quick discovery-rule create --name longfsdfdsfdssdfddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddxxxxxxxxxxxxxx --hostgroup "CentOS 7.3" --search='cpu_count = 1' --organization-titles MyOrg --location-titles MyLoc

Could not create the rule:
  Name is too long (maximum is 255 characters)

Comment 4 Daniel Lobato Garcia 2017-08-09 13:11:49 UTC
Created attachment 1311204 [details]
Max 255 chars

Comment 5 Daniel Lobato Garcia 2017-08-09 13:12:59 UTC
Verified.

Tested on:

foreman-1.15.2-1.el7sat.noarch 
tfm-rubygem-foreman_discovery-9.1.1-1.fm1_15.el7sat.noarch
satellite-6.3.0-16.0.beta.el7sat.noarch

See the screenshot for proof.

Having said that - this should have never been opened as a bug. The search filter should be arbitrarily large so that one could write complex rules if needed, instead of limiting it.

Comment 6 Satellite Program 2018-02-21 16:54:17 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
> 
> For information on the advisory, and where to find the updated files, follow the link below.
> 
> If the solution does not work for you, open a new bug report.
> 
> https://access.redhat.com/errata/RHSA-2018:0336