From b52d8912f9d7174d0ec09e9608893484a40fa51f Mon Sep 17 00:00:00 2001 From: Ferran Rodenas Date: Tue, 5 Mar 2013 13:16:38 +0100 Subject: [PATCH] [openstack|image] Check for glance version (fog only supports v1) --- lib/fog/openstack/image.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/fog/openstack/image.rb b/lib/fog/openstack/image.rb index 76c7a2a1e..74eec7f07 100644 --- a/lib/fog/openstack/image.rb +++ b/lib/fog/openstack/image.rb @@ -206,6 +206,10 @@ module Fog @host = uri.host @path = uri.path @path.sub!(/\/$/, '') + unless @path.match(/v1(\.1)*/) + raise Fog::OpenStack::Errors::ServiceUnavailable.new( + "OpenStack binding only supports version 1.1 (a.k.a. 1)") + end @port = uri.port @scheme = uri.scheme true