Victor Silva
Committed by Gerrit Code Review

OpenFlowDeviceProvider: call modified to properly grab configuration

Call modified() to grab configuration, if it exists. Current
behavior is to ignore previous cfg files and only really change
the property after configuration events.

Co-Authored-By: Thiago Sousa Santos <thiago@waltznetworks.com>

Change-Id: I48408cc77a296f4ed47a026856ca41458c9c62b7
...@@ -37,6 +37,7 @@ import java.util.Dictionary; ...@@ -37,6 +37,7 @@ import java.util.Dictionary;
37 import java.util.HashMap; 37 import java.util.HashMap;
38 import java.util.HashSet; 38 import java.util.HashSet;
39 import java.util.List; 39 import java.util.List;
40 +import java.util.Properties;
40 import java.util.Set; 41 import java.util.Set;
41 import java.util.Timer; 42 import java.util.Timer;
42 43
...@@ -179,6 +180,8 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr ...@@ -179,6 +180,8 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
179 controller.addListener(listener); 180 controller.addListener(listener);
180 controller.addEventListener(listener); 181 controller.addEventListener(listener);
181 182
183 + modified(context);
184 +
182 connectInitialDevices(); 185 connectInitialDevices();
183 LOG.info("Started"); 186 LOG.info("Started");
184 } 187 }
...@@ -197,7 +200,7 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr ...@@ -197,7 +200,7 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
197 200
198 @Modified 201 @Modified
199 public void modified(ComponentContext context) { 202 public void modified(ComponentContext context) {
200 - Dictionary<?, ?> properties = context.getProperties(); 203 + Dictionary<?, ?> properties = context != null ? context.getProperties() : new Properties();
201 int newPortStatsPollFrequency; 204 int newPortStatsPollFrequency;
202 try { 205 try {
203 String s = get(properties, POLL_PROP_NAME); 206 String s = get(properties, POLL_PROP_NAME);
......