cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject [2/5] git commit: updated refs/heads/master to 676b2d1
Date Thu, 24 Jul 2014 12:03:02 GMT
Fix false positve in coverity, simple rewrite. 


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

Branch: refs/heads/master
Commit: ec43bfce90912cf9dc33a97b8a563eb567db222d
Parents: f275f29
Author: Hugo Trippaers <htrippaers@schubergphilis.com>
Authored: Thu Jul 24 12:10:49 2014 +0200
Committer: Hugo Trippaers <htrippaers@schubergphilis.com>
Committed: Thu Jul 24 12:21:37 2014 +0200

----------------------------------------------------------------------
 .../CloudStackPrimaryDataStoreDriverImpl.java      | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec43bfce/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java
b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java
index 5983a05..4115289 100644
--- a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java
+++ b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java
@@ -24,6 +24,8 @@ import java.util.UUID;
 
 import javax.inject.Inject;
 
+import org.apache.log4j.Logger;
+
 import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo;
 import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
 import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
@@ -49,7 +51,6 @@ import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
 import org.apache.cloudstack.storage.to.SnapshotObjectTO;
 import org.apache.cloudstack.storage.to.TemplateObjectTO;
 import org.apache.cloudstack.storage.volume.VolumeObject;
-import org.apache.log4j.Logger;
 
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.storage.ResizeVolumeAnswer;
@@ -258,13 +259,11 @@ public class CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDri
     public boolean canCopy(DataObject srcData, DataObject destData) {
         //BUG fix for CLOUDSTACK-4618
         DataStore store = destData.getDataStore();
-        if (store.getRole() == DataStoreRole.Primary) {
-            if ((srcData.getType() == DataObjectType.TEMPLATE && destData.getType()
== DataObjectType.TEMPLATE) ||
-                    (srcData.getType() == DataObjectType.TEMPLATE && destData.getType()
== DataObjectType.VOLUME)) {
-                StoragePoolVO storagePoolVO = primaryStoreDao.findById(store.getId());
-                if (storagePoolVO != null && storagePoolVO.getPoolType() == Storage.StoragePoolType.CLVM)
{
-                    return true;
-                }
+        if (store.getRole() == DataStoreRole.Primary && srcData.getType() == DataObjectType.TEMPLATE
+                && (destData.getType() == DataObjectType.TEMPLATE || destData.getType()
== DataObjectType.VOLUME)) {
+            StoragePoolVO storagePoolVO = primaryStoreDao.findById(store.getId());
+            if (storagePoolVO != null && storagePoolVO.getPoolType() == Storage.StoragePoolType.CLVM)
{
+                return true;
             }
         }
         return false;
@@ -282,7 +281,7 @@ public class CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDri
             }
 
             CreateObjectCommand cmd = new CreateObjectCommand(snapshotTO);
-            EndPoint ep = this.epSelector.select(snapshot, StorageAction.TAKESNAPSHOT);
+            EndPoint ep = epSelector.select(snapshot, StorageAction.TAKESNAPSHOT);
             Answer answer = null;
 
             if (ep == null) {


Mime
View raw message