Skip to content

Commit 9c4de76

Browse files
jeffmurali-reddy
authored andcommitted
Add pre/post-state transition status to messages published on event bus by UserVmStateListener. Allow system VM resource state post-transitions to be published.
1 parent 06d510a commit 9c4de76

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

server/src/com/cloud/vm/UserVmStateListener.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ public boolean postStateTransitionEvent(State oldState, Event event, State newSt
7777
return false;
7878
}
7979

80+
pubishOnEventBus(event.name(), "postStateTransitionEvent", vo, oldState, newState);
81+
8082
if (vo.getType() != VirtualMachine.Type.User) {
8183
return true;
8284
}
8385

84-
pubishOnEventBus(event.name(), "postStateTransitionEvent", vo, oldState, newState);
85-
8686
if (VirtualMachine.State.isVmCreated(oldState, event, newState)) {
8787
generateUsageEvent(vo.getServiceOfferingId(), vo, EventTypes.EVENT_VM_CREATE);
8888
} else if (VirtualMachine.State.isVmStarted(oldState, event, newState)) {
@@ -128,6 +128,7 @@ private void pubishOnEventBus(String event, String status, VirtualMachine vo, Vi
128128
eventDescription.put("id", vo.getUuid());
129129
eventDescription.put("old-state", oldState.name());
130130
eventDescription.put("new-state", newState.name());
131+
eventDescription.put("status", status);
131132

132133
String eventDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").format(new Date());
133134
eventDescription.put("eventDateTime", eventDate);

0 commit comments

Comments
 (0)