Skip to content

Commit af79d6a

Browse files
jeffyadvr
authored andcommitted
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 9c4de76) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com> Conflicts: server/src/com/cloud/vm/UserVmStateListener.java
1 parent 7e5c7d4 commit af79d6a

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ public boolean postStateTransitionEvent(State oldState, Event event, State newSt
7272
if(!status){
7373
return false;
7474
}
75-
76-
if(vo.getType() != VirtualMachine.Type.User){
75+
76+
pubishOnEventBus(event.name(), "postStateTransitionEvent", vo, oldState, newState);
77+
78+
if (vo.getType() != VirtualMachine.Type.User) {
7779
return true;
7880
}
79-
80-
pubishOnEventBus(event.name(), "postStateTransitionEvent", vo, oldState, newState);
8181

8282
if (VirtualMachine.State.isVmCreated(oldState, event, newState)) {
8383
generateUsageEvent(vo.getServiceOfferingId(), vo, EventTypes.EVENT_VM_CREATE);
@@ -135,6 +135,7 @@ private void pubishOnEventBus(String event, String status, VirtualMachine vo, Vi
135135
eventDescription.put("id", vo.getUuid());
136136
eventDescription.put("old-state", oldState.name());
137137
eventDescription.put("new-state", newState.name());
138+
eventDescription.put("status", status);
138139

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

0 commit comments

Comments
 (0)