This requires a working deltacloud-framework somewhere.
Signed-off-by: Jason Guiditta jason.guiditta@gmail.com --- src/app/models/provider.rb | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/app/models/provider.rb b/src/app/models/provider.rb index 0cbb65a..061f34d 100644 --- a/src/app/models/provider.rb +++ b/src/app/models/provider.rb @@ -9,4 +9,13 @@ class Provider < ActiveRecord::Base
validates_presence_of :cloud_type
+ def validate + if !nil_or_empty(url) + begin + d = DeltaCloud.new(nil, nil, url) + rescue Exception => e + errors.add("url", "must be a valid provider url") + end + end + end end
deltacloud-devel@lists.fedorahosted.org