Merge branch 'fixes' - Upgraded libraries to fix Zookeeper connection dropping
diff --git a/build.xml b/build.xml
index 4aa99bf..e8055e7 100644
--- a/build.xml
+++ b/build.xml
@@ -66,9 +66,10 @@
         <include name="concurrentlinkedhashmap-lru-1.3.jar"/>
         <include name="jython-2.5.2.jar"/>
         <include name="libthrift-0.7.0.jar"/>
-	<include name="curator-client-1.3.1.jar"/>
-	<include name="curator-framework-1.3.1.jar"/>
-	<include name="curator-recipes-1.3.1.jar"/>
+	<include name="curator-client-1.3.3.jar"/>
+	<include name="curator-framework-1.3.3.jar"/>
+	<include name="curator-recipes-1.3.3.jar"/>
+	<include name="zookeeper-3.4.5.jar"/>
     </patternset>
 
     <patternset id="titanlib">
diff --git a/mastership-test.sh b/mastership-test.sh
index 2a83b71..209ffb7 100755
--- a/mastership-test.sh
+++ b/mastership-test.sh
@@ -1,2 +1,2 @@
 #java -Dlogback.configurationFile=logback.xml -cp target/floodlight-only.jar:lib/*:lib/titan/* net.onrc.onos.registry.controller.RegistryRunner $1
-java -Dlogback.configurationFile=logback.xml -cp target/floodlight-only.jar:lib/*:lib/titan/* net.floodlightcontroller.core.Main -cf onos3.properties
+java -Dlogback.configurationFile=logback.xml -cp target/floodlight-only.jar:lib/*:lib/titan/* net.floodlightcontroller.core.Main -cf onos.properties
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 51335fe..025bbfe 100644
--- a/src/main/java/net/onrc/onos/registry/controller/ZookeeperRegistry.java
+++ b/src/main/java/net/onrc/onos/registry/controller/ZookeeperRegistry.java
@@ -208,8 +208,10 @@
 		String latchPath = switchLatchesPath + "/" + dpidStr;
 		
 		if (switchLatches.get(dpidStr) != null){
-			throw new RuntimeException("Leader election for switch " + dpidStr +
-					"is already running");
+			//throw new RuntimeException("Leader election for switch " + dpidStr +
+			//		"is already running");
+			log.debug("Already contesting {}, returning", HexString.toHexString(dpid));
+			return;
 		}
 		
 		LeaderLatch latch = new LeaderLatch(client, latchPath, controllerId);