Bug 858834

Summary: Can't create an organization/env/prod/repo with i18nized names
Product: Red Hat Satellite Reporter: Partha Aji <paji>
Component: Content ManagementAssignee: Katello Bug Bin <katello-bugs>
Status: CLOSED CURRENTRELEASE QA Contact: Og Maciel <omaciel>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: jlaska, omaciel
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-12 15:21:27 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:

Description Partha Aji 2012-09-19 18:55:34 UTC
Description of problem:

I18n characters such as ひらがな, 平仮名" are not allowed to be org names in katello. Now that we have the label fields we should relax this case..


Version-Release number of selected component (if applicable):

CFSE 1.0
How reproducible:

always

Steps to Reproduce:
1. $ ./kk -u admin -p admin org create --name="ひらがな, 平仮名"  
--label="japan-org"                                            

Actual results:
Validation failed: Name cannot contain characters other than alpha numerals, space,'_', '-'.

Expected results:
Valid org with that name created.

Additional info:

Comment 1 Partha Aji 2012-09-19 18:56:28 UTC
Proposed solution .. 

--- a/src/app/models/katello_name_format_validator.rb
+++ b/src/app/models/katello_name_format_validator.rb
@@ -13,7 +13,6 @@
 class KatelloNameFormatValidator < ActiveModel::EachValidator
   def validate_each(record, attribute, value)
     if value
-      record.errors[attribute] << N_("cannot contain characters other than alpha numerals, space,'_', '-'.") unless value =~ /\A[\w| |_|-]
       NoTrailingSpaceValidator.validate_trailing_space(record, attribute, value)
       KatelloNameFormatValidator.validate_length(record, attribute, value)
     else

Comment 3 Og Maciel 2012-10-03 01:56:21 UTC
Verified using:

* candlepin-0.7.8-1.el6cf.noarch
* candlepin-selinux-0.7.8-1.el6cf.noarch
* candlepin-tomcat6-0.7.8-1.el6cf.noarch
* katello-1.1.12-12.el6cf.noarch
* katello-all-1.1.12-12.el6cf.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.1.8-1.el6cf.noarch
* katello-cli-1.1.8-6.el6cf.noarch
* katello-cli-common-1.1.8-6.el6cf.noarch
* katello-common-1.1.12-12.el6cf.noarch
* katello-configure-1.1.9-6.el6cf.noarch
* katello-glue-candlepin-1.1.12-12.el6cf.noarch
* katello-glue-pulp-1.1.12-12.el6cf.noarch
* katello-qpid-broker-key-pair-1.0-1.noarch
* katello-qpid-client-key-pair-1.0-1.noarch
* katello-selinux-1.1.1-1.el6cf.noarch
* pulp-1.1.12-1.el6cf.noarch
* pulp-common-1.1.12-1.el6cf.noarch
* pulp-selinux-server-1.1.12-1.el6cf.noarch

Comment 4 James Laska 2012-12-12 15:21:27 UTC
CloudForms-1.1 shipped with katello-1.1.12-22.el6cf, candlepin-0.7.8.1-1.el6cf  and pulp-1.1.14-1.el6cf

Marking this bug CLOSED CURRENTRELEASE.  Please reopen if the problem has not   been addressed in the 1.1 product.