From 1e0fa9af892c482073d3dba2ee257c4c8d5a2afa Mon Sep 17 00:00:00 2001 From: Patrick Debois Date: Fri, 30 Sep 2011 16:12:18 +0200 Subject: [PATCH] [Compute|Libvirt] Take into account a query string can be empty, different on some rubies it gives nil, on some empty string --- lib/fog/libvirt/models/compute/uri.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/fog/libvirt/models/compute/uri.rb b/lib/fog/libvirt/models/compute/uri.rb index 11a824d56..cfab55b6e 100644 --- a/lib/fog/libvirt/models/compute/uri.rb +++ b/lib/fog/libvirt/models/compute/uri.rb @@ -126,9 +126,13 @@ module Fog # http://libvirt.org/remote.html private def value(name) - params=CGI.parse(@parsed_uri.query) - if params.has_key?(name) - return params[name].first + unless @parsed_uri.query.nil? + params=CGI.parse(@parsed_uri.query) + if params.has_key?(name) + return params[name].first + else + return nil + end else return nil end