mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-6467: Add pre/post-state transition status to messages published on
... event bus by UserVmStateListener. Allow system VM resource state
post-transitions to be published.
(cherry picked from commit 9c4de764f7)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Conflicts:
server/src/com/cloud/vm/UserVmStateListener.java
This commit is contained in:
parent
7e5c7d488a
commit
af79d6aaf7
|
|
@ -72,12 +72,12 @@ public class UserVmStateListener implements StateListener<State, VirtualMachine.
|
|||
if(!status){
|
||||
return false;
|
||||
}
|
||||
|
||||
if(vo.getType() != VirtualMachine.Type.User){
|
||||
|
||||
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);
|
||||
|
|
@ -135,6 +135,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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue