More bad input handling
Change-Id: I3509892b187138b725d139a2975746e874cba5bb
diff --git a/TestON/tests/HAclusterRestart/HAclusterRestart.py b/TestON/tests/HAclusterRestart/HAclusterRestart.py
index 234c995..0c3ce16 100644
--- a/TestON/tests/HAclusterRestart/HAclusterRestart.py
+++ b/TestON/tests/HAclusterRestart/HAclusterRestart.py
@@ -2197,12 +2197,13 @@
hosts.append( None )
for controller in range( 0, len( hosts ) ):
controllerStr = str( controller + 1 )
- for host in hosts[ controller ]:
- if host is None or host.get( 'ipAddresses', [] ) == []:
- main.log.error(
- "Error with host ipAddresses on controller" +
- controllerStr + ": " + str( host ) )
- ipResult = main.FALSE
+ if hosts[ controller ]:
+ for host in hosts[ controller ]:
+ if host is None or host.get( 'ipAddresses', [] ) == []:
+ main.log.error(
+ "Error with host ipAddresses on controller" +
+ controllerStr + ": " + str( host ) )
+ ipResult = main.FALSE
ports = []
threads = []
for i in range( main.numCtrls ):
diff --git a/TestON/tests/HAkillNodes/HAkillNodes.py b/TestON/tests/HAkillNodes/HAkillNodes.py
index 396e08a..5768a2d 100644
--- a/TestON/tests/HAkillNodes/HAkillNodes.py
+++ b/TestON/tests/HAkillNodes/HAkillNodes.py
@@ -2194,12 +2194,13 @@
hosts.append( None )
for controller in range( 0, len( hosts ) ):
controllerStr = str( main.activeNodes[controller] + 1 )
- for host in hosts[ controller ]:
- if host is None or host.get( 'ipAddresses', [] ) == []:
- main.log.error(
- "Error with host ipAddresses on controller" +
- controllerStr + ": " + str( host ) )
- ipResult = main.FALSE
+ if hosts[ controller ]:
+ for host in hosts[ controller ]:
+ if host is None or host.get( 'ipAddresses', [] ) == []:
+ main.log.error(
+ "Error with host ipAddresses on controller" +
+ controllerStr + ": " + str( host ) )
+ ipResult = main.FALSE
ports = []
threads = []
for i in main.activeNodes:
diff --git a/TestON/tests/HAsanity/HAsanity.py b/TestON/tests/HAsanity/HAsanity.py
index 517d53e..5322a9a 100644
--- a/TestON/tests/HAsanity/HAsanity.py
+++ b/TestON/tests/HAsanity/HAsanity.py
@@ -2090,12 +2090,13 @@
hosts.append( None )
for controller in range( 0, len( hosts ) ):
controllerStr = str( controller + 1 )
- for host in hosts[ controller ]:
- if host is None or host.get( 'ipAddresses', [] ) == []:
- main.log.error(
- "Error with host ipAddresses on controller" +
- controllerStr + ": " + str( host ) )
- ipResult = main.FALSE
+ if hosts[ controller ]:
+ for host in hosts[ controller ]:
+ if host is None or host.get( 'ipAddresses', [] ) == []:
+ main.log.error(
+ "Error with host ipAddresses on controller" +
+ controllerStr + ": " + str( host ) )
+ ipResult = main.FALSE
ports = []
threads = []
for i in range( main.numCtrls ):
diff --git a/TestON/tests/HAstopNodes/HAstopNodes.py b/TestON/tests/HAstopNodes/HAstopNodes.py
index 84b714d..84e7d9c 100644
--- a/TestON/tests/HAstopNodes/HAstopNodes.py
+++ b/TestON/tests/HAstopNodes/HAstopNodes.py
@@ -2183,12 +2183,13 @@
hosts.append( None )
for controller in range( 0, len( hosts ) ):
controllerStr = str( main.activeNodes[controller] + 1 )
- for host in hosts[ controller ]:
- if host is None or host.get( 'ipAddresses', [] ) == []:
- main.log.error(
- "Error with host ipAddresses on controller" +
- controllerStr + ": " + str( host ) )
- ipResult = main.FALSE
+ if hosts[ controller ]:
+ for host in hosts[ controller ]:
+ if host is None or host.get( 'ipAddresses', [] ) == []:
+ main.log.error(
+ "Error with host ipAddresses on controller" +
+ controllerStr + ": " + str( host ) )
+ ipResult = main.FALSE
ports = []
threads = []
for i in main.activeNodes: