[katello-devel] Katello Url Format Validator

Jason Rist jrist at redhat.com
Fri Jul 1 18:54:26 UTC 2011


On 07/01/2011 12:15 PM, Adam Price wrote:
> I came up with a little validator for checking URLs in the provider,
> then decided to make it a little more generic so that other things can
> use it as well.
> 
> Right now the only thing using it is the Provider model, but hopefully
> we can get it hooked up to Repositories also.
> 
> |validates :repository_url, :katello_url_format => {:protocol =>
> ["https"]}, :allow_nil => false, :if => :rh_repo?|
> 
> The line above is what is in Provider.rb. KatelloUrlFormatValidator
> takes an option specifying a list of protocols you want it to accept
> ("https", "http", "ftp", "ssh", or whatever...) and it builds the
> regular expression. The regular expression accepts port numbers,
> subdomains, file paths after the domain, and also parameters.
> 
> Wanted to let you know so that hopefully it will get used elsewhere.
> Thanks.
> 
> 
> 
> _______________________________________________
> katello-devel mailing list
> katello-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/katello-devel
Adam - this is great.  Mind adding it to the fedora hosted wiki?  Very
helpful.

-J

-- 
Jason E. Rist
Senior Software Engineer
Systems Management and Cloud Enablement
Red Hat, Inc.
+1.919.754.4048
Freenode: jrist




More information about the katello-devel mailing list