Merge remote-tracking branch 'upstream/master'
diff --git a/src/main/java/net/onrc/onos/registry/controller/ZookeeperRegistry.java b/src/main/java/net/onrc/onos/registry/controller/ZookeeperRegistry.java
index a929aa9..76b7ebd 100644
--- a/src/main/java/net/onrc/onos/registry/controller/ZookeeperRegistry.java
+++ b/src/main/java/net/onrc/onos/registry/controller/ZookeeperRegistry.java
@@ -297,6 +297,17 @@
 			return null;
 		}
 		
+		try {
+			//We've seen issues with these caches get stuck out of date, so we'll have to
+			//force them to refresh before each read. This slows down the method as it
+			//blocks on a Zookeeper query, however at the moment only the cleanup thread
+			//uses this and that isn't particularly time-sensitive.
+			switchCache.rebuild();
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		
 		List<ChildData> sortedData = new ArrayList<ChildData>(switchCache.getCurrentData()); 
 		
 		Collections.sort(
diff --git a/web/add_flow.py b/web/add_flow.py
index 0440c39..0ab6847 100755
--- a/web/add_flow.py
+++ b/web/add_flow.py
@@ -372,6 +372,7 @@
 
 if __name__ == "__main__":
   usage_msg = "Usage: %s [Flags] <flow-id> <installer-id> <src-dpid> <src-port> <dest-dpid> <dest-port> [Match Conditions] [Actions]\n" % (sys.argv[0])
+  usage_msg = usage_msg + "\n"
   usage_msg = usage_msg + "    Flags:\n"
   usage_msg = usage_msg + "        -m              Monitor and maintain the installed shortest path(s)\n"
   usage_msg = usage_msg + "        -f <filename>   Read the flow(s) to install from a file\n"
diff --git a/web/clear_flow.py b/web/clear_flow.py
index df6302e..50678e2 100755
--- a/web/clear_flow.py
+++ b/web/clear_flow.py
@@ -45,7 +45,12 @@
 
 if __name__ == "__main__":
   usage_msg = "Clear flow state from the ONOS Network Map\n"
-  usage_msg = usage_msg + "Usage: %s <begin-flow-id> [<end-flow-id>]\n" % (sys.argv[0])
+  usage_msg = usage_msg + "Usage: %s <begin-flow-id> <end-flow-id>\n" % (sys.argv[0])
+  usage_msg = usage_msg + "       %s <flow-id>\n" % (sys.argv[0])
+  usage_msg = usage_msg + "\n"
+  usage_msg = usage_msg + "    Arguments:\n"
+  usage_msg = usage_msg + "        <begin-flow-id> <end-flow-id>      Clear all flows in the flow ID range\n"
+  usage_msg = usage_msg + "        <flow-id>                          Clear a single flow with the flow ID\n"
 
   # app.debug = False;
 
diff --git a/web/delete_flow.py b/web/delete_flow.py
index 6d26548..ff4caff 100755
--- a/web/delete_flow.py
+++ b/web/delete_flow.py
@@ -45,7 +45,12 @@
 
 if __name__ == "__main__":
   usage_msg = "Delete flow state from the ONOS Network Map and the switches\n"
-  usage_msg = usage_msg + "Usage: %s <begin-flow-id> [<end-flow-id>]\n" % (sys.argv[0])
+  usage_msg = usage_msg + "Usage: %s <begin-flow-id> <end-flow-id>\n" % (sys.argv[0])
+  usage_msg = usage_msg + "       %s <flow-id>\n" % (sys.argv[0])
+  usage_msg = usage_msg + "\n"
+  usage_msg = usage_msg + "    Arguments:\n"
+  usage_msg = usage_msg + "        <begin-flow-id> <end-flow-id>      Delete all flows in the flow ID range\n"
+  usage_msg = usage_msg + "        <flow-id>                          Delete a single flow with the flow ID\n"
 
   # app.debug = False;
 
diff --git a/web/generate_flows.py b/web/generate_flows.py
index 953fc03..492b8cb 100755
--- a/web/generate_flows.py
+++ b/web/generate_flows.py
@@ -39,7 +39,16 @@
 
 
 if __name__ == "__main__":
-  usage_msg = "Usage: %s <begin-flow-id> <end-flow-id>\n" % (sys.argv[0])
+  usage_msg = "Generate a number of flows by using a pre-defined template.\n"
+  usage_msg = usage_msg + "\n"
+  usage_msg = usage_msg + "NOTE: This script is work-in-progress. Currently all flows are within same\n"
+  usage_msg = usage_msg + "pair of switch ports and contain auto-generated MAC-based matching conditions.\n"
+  usage_msg = usage_msg + "\n"
+  usage_msg = usage_msg + "Usage: %s <begin-flow-id> <end-flow-id>\n" % (sys.argv[0])
+  usage_msg = usage_msg + "\n"
+  usage_msg = usage_msg + "    The output should be saved to a file, and the flows should be installed\n"
+  usage_msg = usage_msg + "    by using the command './add_flow.py -f filename'\n"
+
 
   # app.debug = False;
 
diff --git a/web/shortest_path.py b/web/shortest_path.py
index 751489f..0f23bf4 100755
--- a/web/shortest_path.py
+++ b/web/shortest_path.py
@@ -71,7 +71,8 @@
 
 
 if __name__ == "__main__":
-  usage_msg = "Usage: %s <src-dpid> <src-port> <dest-dpid> <dest-port>" % (sys.argv[0])
+  usage_msg = "Compute the shortest path between two switch ports in the Network MAP\n"
+  usage_msg = usage_msg + "Usage: %s <src-dpid> <src-port> <dest-dpid> <dest-port>" % (sys.argv[0])
 
   # app.debug = False;