cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kis...@apache.org
Subject [2/2] git commit: updated refs/heads/master to 9eb8d53
Date Wed, 07 Jan 2015 07:11:23 GMT
For volumes created from template, do not log offering ID in VOLUME.CREATE in usage_event.
Moved offering type to DiskOffering interface


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

Branch: refs/heads/master
Commit: 9eb8d538dd196f27e5194dd2e657afffdb9347eb
Parents: 42cecbb
Author: Kishan Kavala <kishan@apache.org>
Authored: Fri Nov 21 14:33:39 2014 +0530
Committer: Kishan Kavala <kishan@apache.org>
Committed: Wed Jan 7 12:31:41 2015 +0530

----------------------------------------------------------------------
 api/src/com/cloud/offering/DiskOffering.java                   | 6 ++++++
 .../cloudstack/engine/orchestration/VolumeOrchestrator.java    | 4 +++-
 engine/schema/src/com/cloud/storage/DiskOfferingVO.java        | 3 ---
 .../schema/src/com/cloud/storage/dao/DiskOfferingDaoImpl.java  | 2 +-
 server/src/com/cloud/api/query/vo/DiskOfferingJoinVO.java      | 2 +-
 5 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9eb8d538/api/src/com/cloud/offering/DiskOffering.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/offering/DiskOffering.java b/api/src/com/cloud/offering/DiskOffering.java
index 928f713..c2069c2 100644
--- a/api/src/com/cloud/offering/DiskOffering.java
+++ b/api/src/com/cloud/offering/DiskOffering.java
@@ -34,6 +34,10 @@ public interface DiskOffering extends InfrastructureEntity, Identity, InternalId
         Inactive, Active,
     }
 
+    public enum Type {
+        Disk, Service
+    };
+
     State getState();
 
     public enum DiskCacheMode {
@@ -114,4 +118,6 @@ public interface DiskOffering extends InfrastructureEntity, Identity,
InternalId
     DiskCacheMode getCacheMode();
 
     void setCacheMode(DiskCacheMode cacheMode);
+
+    Type getType();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9eb8d538/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
index 1b87ccf..396a49c 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
@@ -712,7 +712,9 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
 
             Long offeringId = null;
 
-            offeringId = offering.getId();
+            if (offering.getType() == DiskOffering.Type.Disk) {
+                offeringId = offering.getId();
+            }
 
             UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_CREATE, vol.getAccountId(),
vol.getDataCenterId(), vol.getId(), vol.getName(), offeringId, vol.getTemplateId(), size,
                     Volume.class.getName(), vol.getUuid(), vol.isDisplayVolume());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9eb8d538/engine/schema/src/com/cloud/storage/DiskOfferingVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/DiskOfferingVO.java b/engine/schema/src/com/cloud/storage/DiskOfferingVO.java
index 74f65ab..5de7f98 100644
--- a/engine/schema/src/com/cloud/storage/DiskOfferingVO.java
+++ b/engine/schema/src/com/cloud/storage/DiskOfferingVO.java
@@ -44,9 +44,6 @@ import com.cloud.utils.db.GenericDao;
 @Inheritance(strategy = InheritanceType.JOINED)
 @DiscriminatorColumn(name = "type", discriminatorType = DiscriminatorType.STRING, length
= 32)
 public class DiskOfferingVO implements DiskOffering {
-    public enum Type {
-        Disk, Service
-    };
 
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9eb8d538/engine/schema/src/com/cloud/storage/dao/DiskOfferingDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/dao/DiskOfferingDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/DiskOfferingDaoImpl.java
index 818a5b5..ba84062 100644
--- a/engine/schema/src/com/cloud/storage/dao/DiskOfferingDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/DiskOfferingDaoImpl.java
@@ -25,7 +25,7 @@ import javax.persistence.EntityExistsException;
 import org.springframework.stereotype.Component;
 
 import com.cloud.storage.DiskOfferingVO;
-import com.cloud.storage.DiskOfferingVO.Type;
+import com.cloud.offering.DiskOffering.Type;
 import com.cloud.utils.db.Attribute;
 import com.cloud.utils.db.Filter;
 import com.cloud.utils.db.GenericDaoBase;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9eb8d538/server/src/com/cloud/api/query/vo/DiskOfferingJoinVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/vo/DiskOfferingJoinVO.java b/server/src/com/cloud/api/query/vo/DiskOfferingJoinVO.java
index 58eeef9..e846b0b 100644
--- a/server/src/com/cloud/api/query/vo/DiskOfferingJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/DiskOfferingJoinVO.java
@@ -27,7 +27,7 @@ import com.cloud.storage.Storage;
 import org.apache.cloudstack.api.Identity;
 import org.apache.cloudstack.api.InternalIdentity;
 
-import com.cloud.storage.DiskOfferingVO.Type;
+import com.cloud.offering.DiskOffering.Type;
 import com.cloud.utils.db.GenericDao;
 
 @Entity


Mime
View raw message