On Tue, 2012-03-13 at 14:42 +0100, [email protected] wrote:
> From: Michal Fojtik <[email protected]>
>
>
> Signed-off-by: Michal fojtik <[email protected]>
> ---
> .../lib/deltacloud/drivers/rhevm/rhevm_driver.rb | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
> b/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
> index ac4fe72..05fdbaf 100644
> --- a/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
> +++ b/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
> @@ -206,8 +206,9 @@ class RHEVMDriver < Deltacloud::BaseDriver
> private
>
> def new_client(credentials)
> - url, datacenter = api_provider.split(';')
> safely do
> + raise 'No API provider set for this request.' unless api_provider
> + url, datacenter = api_provider.split(';')
While we're doing error checks, we should cover the case where
api_provider.split(';').size != 2 To be defensive, I'd do
ary = api_provider.split(';')
datacenter = ary.pop
url = ary.join(';')
David