Repository: cloudstack
Updated Branches:
  refs/heads/master 06d510abc -> 9c4de764f


Add pre/post-state transition status to messages published on event bus by 
UserVmStateListener. Allow system VM resource state post-transitions to be 
published.


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

Branch: refs/heads/master
Commit: 9c4de764f74bffd5cd547f8514d4a6897fb961c2
Parents: 06d510a
Author: jeff <j...@greenqloud.com>
Authored: Mon Apr 21 14:47:12 2014 +0000
Committer: Murali Reddy <muralimmre...@gmail.com>
Committed: Thu Apr 24 20:05:26 2014 +0530

----------------------------------------------------------------------
 server/src/com/cloud/vm/UserVmStateListener.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9c4de764/server/src/com/cloud/vm/UserVmStateListener.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmStateListener.java 
b/server/src/com/cloud/vm/UserVmStateListener.java
index 202391f..6631ca3 100644
--- a/server/src/com/cloud/vm/UserVmStateListener.java
+++ b/server/src/com/cloud/vm/UserVmStateListener.java
@@ -77,12 +77,12 @@ public class UserVmStateListener implements 
StateListener<State, VirtualMachine.
             return false;
         }
 
+        pubishOnEventBus(event.name(), "postStateTransitionEvent", vo, 
oldState, newState);
+
         if (vo.getType() != VirtualMachine.Type.User) {
             return true;
         }
 
-        pubishOnEventBus(event.name(), "postStateTransitionEvent", vo, 
oldState, newState);
-
         if (VirtualMachine.State.isVmCreated(oldState, event, newState)) {
             generateUsageEvent(vo.getServiceOfferingId(), vo, 
EventTypes.EVENT_VM_CREATE);
         } else if (VirtualMachine.State.isVmStarted(oldState, event, 
newState)) {
@@ -128,6 +128,7 @@ public class UserVmStateListener implements 
StateListener<State, VirtualMachine.
         eventDescription.put("id", vo.getUuid());
         eventDescription.put("old-state", oldState.name());
         eventDescription.put("new-state", newState.name());
+        eventDescription.put("status", status);
 
         String eventDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss 
Z").format(new Date());
         eventDescription.put("eventDateTime", eventDate);

Reply via email to