You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2012/10/19 11:03:11 UTC

[1/2] git commit: Fixing volume find to return [] in case the array is empty

Updated Branches:
  refs/heads/master adade3245 -> c96c7d3dd


Fixing volume find to return [] in case the array is empty


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/c96c7d3d
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/c96c7d3d
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/c96c7d3d

Branch: refs/heads/master
Commit: c96c7d3dd0f69039f95b405950c3146c23fdb10d
Parents: 630854b
Author: Oved Ourfali <oo...@redhat.com>
Authored: Thu Oct 18 12:28:25 2012 +0200
Committer: Michal fojtik <mf...@redhat.com>
Committed: Fri Oct 19 11:02:44 2012 +0200

----------------------------------------------------------------------
 server/lib/cimi/models/volume.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/c96c7d3d/server/lib/cimi/models/volume.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/volume.rb b/server/lib/cimi/models/volume.rb
index 8d32c66..8a60ae8 100644
--- a/server/lib/cimi/models/volume.rb
+++ b/server/lib/cimi/models/volume.rb
@@ -40,7 +40,7 @@ class CIMI::Model::Volume < CIMI::Model::Base
     opts = ( id == :all ) ? {} : { :id => id }
     volumes = context.driver.storage_volumes(context.credentials, opts)
     volumes.collect!{ |volume| from_storage_volume(volume, context) }
-    return volumes.first unless volumes.length > 1
+    return volumes.first unless volumes.length > 1 || volumes.length == 0
     return volumes
   end