deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [1/2] git commit: Fixing volume find to return [] in case the array is empty
Date Fri, 19 Oct 2012 09:03:11 GMT
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 <oourfali@redhat.com>
Authored: Thu Oct 18 12:28:25 2012 +0200
Committer: Michal fojtik <mfojtik@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
 


Mime
View raw message