From 0e33ba8d353aa0ae7bac5260daa0d710306372bb Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Thu, 21 Mar 2013 17:38:33 +0530 Subject: [PATCH] CLOUDSTACK-1368: Shared network - Not able to delete network because of java.lang.NullPointerException Missed network destroy state transistion while 'events framework' merge. Before merge, network states were explicitly set. It was changed to go through state machine. This fix, introduces missing state transistions. Tested life cycle of both isolated and shared network Signed-off-by: Murali Reddy --- api/src/com/cloud/network/Network.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/src/com/cloud/network/Network.java b/api/src/com/cloud/network/Network.java index 2bf7b7f8000..e13bca53c0f 100644 --- a/api/src/com/cloud/network/Network.java +++ b/api/src/com/cloud/network/Network.java @@ -235,6 +235,8 @@ public interface Network extends ControlledEntity, StateObject, I s_fsm.addTransition(State.Implemented, Event.DestroyNetwork, State.Shutdown); s_fsm.addTransition(State.Shutdown, Event.OperationSucceeded, State.Allocated); s_fsm.addTransition(State.Shutdown, Event.OperationFailed, State.Implemented); + s_fsm.addTransition(State.Setup, Event.DestroyNetwork, State.Destroy); + s_fsm.addTransition(State.Allocated, Event.DestroyNetwork, State.Destroy); } public static StateMachine2 getStateMachine() {