Activate Switch if added again
diff --git a/src/main/java/net/floodlightcontroller/core/internal/SwitchStorageImpl.java b/src/main/java/net/floodlightcontroller/core/internal/SwitchStorageImpl.java
index 27d2a9f..1be6e44 100644
--- a/src/main/java/net/floodlightcontroller/core/internal/SwitchStorageImpl.java
+++ b/src/main/java/net/floodlightcontroller/core/internal/SwitchStorageImpl.java
@@ -127,7 +127,11 @@
/*
* Do nothing or throw exception?
*/
- log.info("SwitchStorage:addSwitch dpid:{} already exists", dpid);
+ Vertex sw = graph.getVertices("dpid",dpid).iterator().next();
+
+ log.info("SwitchStorage:addSwitch dpid:{} already exists", dpid);
+ sw.setProperty("state",SwitchState.ACTIVE.toString());
+ graph.stopTransaction(Conclusion.SUCCESS);
} else {
Vertex sw = graph.addVertex(null);