Fix some startup issues now that we use cluster size

- Change max cluster size to size of largest cluster
- Cleanup some reading of params
- Catch when ONOS isn't fully started

Change-Id: I5b2ca791046bd4061d31355276958ead39f8b65c
(cherry picked from commit ace1f317e19fd50924e78e53b566d69db23f5683)
diff --git a/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.topo b/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.topo
index d51ca99..86018c5 100755
--- a/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.topo
+++ b/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.topo
@@ -18,7 +18,7 @@
                 <rest_port></rest_port>
                 <prompt></prompt>  # TODO: we technically need a few of these, one per component
                 <onos_home></onos_home>  # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
-                <nodes> 1 </nodes>  # number of nodes in the cluster
+                <nodes> 7 </nodes>  # number of nodes in the cluster
             </COMPONENTS>
         </ONOScell>
 
diff --git a/TestON/tests/FUNC/FUNCflow/FUNCflow.topo b/TestON/tests/FUNC/FUNCflow/FUNCflow.topo
index 6c4b8aa..1c876f8 100755
--- a/TestON/tests/FUNC/FUNCflow/FUNCflow.topo
+++ b/TestON/tests/FUNC/FUNCflow/FUNCflow.topo
@@ -18,7 +18,7 @@
                 <rest_port></rest_port>
                 <prompt></prompt>  # TODO: we technically need a few of these, one per component
                 <onos_home></onos_home>  # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
-                <nodes> 1 </nodes>  # number of nodes in the cluster
+                <nodes> 7 </nodes>  # number of nodes in the cluster
             </COMPONENTS>
         </ONOScell>
 
diff --git a/TestON/tests/FUNC/FUNCgroup/FUNCgroup.topo b/TestON/tests/FUNC/FUNCgroup/FUNCgroup.topo
index 6c4b8aa..1c876f8 100644
--- a/TestON/tests/FUNC/FUNCgroup/FUNCgroup.topo
+++ b/TestON/tests/FUNC/FUNCgroup/FUNCgroup.topo
@@ -18,7 +18,7 @@
                 <rest_port></rest_port>
                 <prompt></prompt>  # TODO: we technically need a few of these, one per component
                 <onos_home></onos_home>  # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
-                <nodes> 1 </nodes>  # number of nodes in the cluster
+                <nodes> 7 </nodes>  # number of nodes in the cluster
             </COMPONENTS>
         </ONOScell>
 
diff --git a/TestON/tests/FUNC/FUNCgroup/FUNCgroup.topo.physical b/TestON/tests/FUNC/FUNCgroup/FUNCgroup.topo.physical
index 1250fd9..74488e4 100644
--- a/TestON/tests/FUNC/FUNCgroup/FUNCgroup.topo.physical
+++ b/TestON/tests/FUNC/FUNCgroup/FUNCgroup.topo.physical
@@ -18,7 +18,7 @@
                 <rest_port></rest_port>
                 <prompt></prompt>  # TODO: we technically need a few of these, one per component
                 <onos_home></onos_home>  # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
-                <nodes> 1 </nodes>  # number of nodes in the cluster
+                <nodes> 7 </nodes>  # number of nodes in the cluster
             </COMPONENTS>
         </ONOScell>
 
diff --git a/TestON/tests/FUNC/FUNCintent/FUNCintent.topo b/TestON/tests/FUNC/FUNCintent/FUNCintent.topo
index b6a4aa5..fa04a90 100755
--- a/TestON/tests/FUNC/FUNCintent/FUNCintent.topo
+++ b/TestON/tests/FUNC/FUNCintent/FUNCintent.topo
@@ -18,7 +18,7 @@
                 <rest_port></rest_port>
                 <prompt></prompt>  # TODO: we technically need a few of these, one per component
                 <onos_home></onos_home>  # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
-                <nodes> 3 </nodes>  # number of nodes in the cluster
+                <nodes> 7 </nodes>  # number of nodes in the cluster
             </COMPONENTS>
         </ONOScell>
 
diff --git a/TestON/tests/FUNC/FUNCintent/FUNCintent.topo.physical b/TestON/tests/FUNC/FUNCintent/FUNCintent.topo.physical
index 9a3c4a2..4925c79 100755
--- a/TestON/tests/FUNC/FUNCintent/FUNCintent.topo.physical
+++ b/TestON/tests/FUNC/FUNCintent/FUNCintent.topo.physical
@@ -18,7 +18,7 @@
                 <rest_port></rest_port>
                 <prompt></prompt>  # TODO: we technically need a few of these, one per component
                 <onos_home></onos_home>  # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
-                <nodes> 3 </nodes>  # number of nodes in the cluster
+                <nodes> 7 </nodes>  # number of nodes in the cluster
             </COMPONENTS>
         </ONOScell>
 
diff --git a/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.topo b/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.topo
index 5acb7f9..dac0a5c 100755
--- a/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.topo
+++ b/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.topo
@@ -18,7 +18,7 @@
                 <rest_port></rest_port>
                 <prompt></prompt>  # TODO: we technically need a few of these, one per component
                 <onos_home></onos_home>  # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
-                <nodes> 3 </nodes>  # number of nodes in the cluster
+                <nodes> 7 </nodes>  # number of nodes in the cluster
             </COMPONENTS>
         </ONOScell>
 
diff --git a/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.topo b/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.topo
index 658bac3..99e23a8 100755
--- a/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.topo
+++ b/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.topo
@@ -18,7 +18,7 @@
                 <rest_port></rest_port>
                 <prompt></prompt>  # TODO: we technically need a few of these, one per component
                 <onos_home></onos_home>  # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
-                <nodes> 5 </nodes>  # number of nodes in the cluster
+                <nodes> 7 </nodes>  # number of nodes in the cluster
             </COMPONENTS>
         </ONOScell>
 
diff --git a/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.topo b/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.topo
index f149a02..8771869 100755
--- a/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.topo
+++ b/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.topo
@@ -18,7 +18,7 @@
                 <rest_port></rest_port>
                 <prompt></prompt>  # TODO: we technically need a few of these, one per component
                 <onos_home></onos_home>  # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
-                <nodes> 3 </nodes>  # number of nodes in the cluster
+                <nodes> 7 </nodes>  # number of nodes in the cluster
             </COMPONENTS>
         </ONOScell>
 
diff --git a/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.topo b/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.topo
index a8c1b2d..99e23a8 100644
--- a/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.topo
+++ b/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.topo
@@ -18,7 +18,7 @@
                 <rest_port></rest_port>
                 <prompt></prompt>  # TODO: we technically need a few of these, one per component
                 <onos_home></onos_home>  # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
-                <nodes> 3 </nodes>  # number of nodes in the cluster
+                <nodes> 7 </nodes>  # number of nodes in the cluster
             </COMPONENTS>
         </ONOScell>
 
diff --git a/TestON/tests/FUNC/FUNCoptical/FUNCoptical.topo b/TestON/tests/FUNC/FUNCoptical/FUNCoptical.topo
index 33a3845..0202860 100755
--- a/TestON/tests/FUNC/FUNCoptical/FUNCoptical.topo
+++ b/TestON/tests/FUNC/FUNCoptical/FUNCoptical.topo
@@ -18,7 +18,7 @@
                 <rest_port></rest_port>
                 <prompt></prompt>  # TODO: we technically need a few of these, one per component
                 <onos_home></onos_home>  # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
-                <nodes> 3 </nodes>  # number of nodes in the cluster
+                <nodes> 7 </nodes>  # number of nodes in the cluster
             </COMPONENTS>
         </ONOScell>
 
diff --git a/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.topo b/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.topo
index cf64189..6696695 100644
--- a/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.topo
+++ b/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.topo
@@ -18,7 +18,7 @@
                 <rest_port></rest_port>
                 <prompt></prompt>  # TODO: we technically need a few of these, one per component
                 <onos_home></onos_home>  # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
-                <nodes> 1 </nodes>  # number of nodes in the cluster
+                <nodes> 7 </nodes>  # number of nodes in the cluster
             </COMPONENTS>
         </ONOScell>
 
diff --git a/TestON/tests/FUNC/FUNCvirNetNB/FUNCvirNetNB.topo b/TestON/tests/FUNC/FUNCvirNetNB/FUNCvirNetNB.topo
index b5ceb3f..2abd6ad 100644
--- a/TestON/tests/FUNC/FUNCvirNetNB/FUNCvirNetNB.topo
+++ b/TestON/tests/FUNC/FUNCvirNetNB/FUNCvirNetNB.topo
@@ -18,7 +18,7 @@
                 <rest_port></rest_port>
                 <prompt></prompt>  # TODO: we technically need a few of these, one per component
                 <onos_home></onos_home>  # defines where onos home is on the target cell machine. Defaults to entry in "home" if empty.
-                <nodes> 1 </nodes>  # number of nodes in the cluster
+                <nodes> 7 </nodes>  # number of nodes in the cluster
             </COMPONENTS>
         </ONOScell>