[katello-devel] Katello Url Format Validator

Jason Rist jrist at redhat.com
Fri Jul 1 20:38:11 UTC 2011


On 07/01/2011 01:59 PM, Adam Price wrote:
> On 07/01/2011 02:54 PM, Jason Rist wrote:
>> 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
>>
> Wiki page can be found here
> <https://fedorahosted.org/katello/wiki/katelloUrlFormatValidator>
> 
> Functionality is pretty small now, but I'll probably add more. Anything
> else people would like to see in it?
> 
> 
> 
> _______________________________________________
> katello-devel mailing list
> katello-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/katello-devel
Awesome! Thanks.

-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