[ONOS-6623]: Fix parsing of hosts json
Change-Id: I7e612bb9a1b8e5e63894b2698ab40db653ad6473
diff --git a/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py b/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py
index f295b11..9159e4d 100644
--- a/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py
+++ b/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py
@@ -1992,8 +1992,8 @@
main.hostsData[ host ][ 'id' ] = hostj[ 'id' ]
main.hostsData[ host ][ 'vlan' ] = hostj[ 'vlan' ]
main.hostsData[ host ][ 'location' ] = \
- hostj[ 'location' ][ 'elementId' ] + '/' + \
- hostj[ 'location' ][ 'port' ]
+ hostj[ 'locations' ][ 0 ][ 'elementId' ] + '/' + \
+ hostj[ 'locations' ][ 0 ][ 'port' ]
main.hostsData[ host ][ 'ipAddresses' ] = hostj[ 'ipAddresses' ]
return main.TRUE
except ValueError:
diff --git a/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py b/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py
index 4bbbd9f..38861b6 100644
--- a/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py
+++ b/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py
@@ -1335,8 +1335,8 @@
main.hostsData[ host ][ 'id' ] = hostj[ 'id' ]
main.hostsData[ host ][ 'vlan' ] = hostj[ 'vlan' ]
main.hostsData[ host ][ 'location' ] = \
- hostj[ 'location' ][ 'elementId' ] + '/' + \
- hostj[ 'location' ][ 'port' ]
+ hostj[ 'locations' ][ 0 ][ 'elementId' ] + '/' + \
+ hostj[ 'locations' ][ 0 ][ 'port' ]
main.hostsData[ host ][ 'ipAddresses' ] = hostj[ 'ipAddresses' ]
main.log.info( "Deactivating reactive forwarding app " )
@@ -1549,8 +1549,8 @@
main.hostsData[ host ][ 'id' ] = hostj[ 'id' ]
main.hostsData[ host ][ 'vlan' ] = hostj[ 'vlan' ]
main.hostsData[ host ][ 'location' ] = \
- hostj[ 'location' ][ 'elementId' ] + '/' + \
- hostj[ 'location' ][ 'port' ]
+ hostj[ 'locations' ][ 0 ][ 'elementId' ] + '/' + \
+ hostj[ 'locations' ][ 0 ][ 'port' ]
main.hostsData[ host ][ 'ipAddresses' ] = hostj[ 'ipAddresses' ]
return main.TRUE
except ValueError:
diff --git a/TestON/tests/FUNC/FUNCipv6Intent/dependencies/FUNCIpv6IntentFunction.py b/TestON/tests/FUNC/FUNCipv6Intent/dependencies/FUNCIpv6IntentFunction.py
index 511eb32..2a2330d 100644
--- a/TestON/tests/FUNC/FUNCipv6Intent/dependencies/FUNCIpv6IntentFunction.py
+++ b/TestON/tests/FUNC/FUNCipv6Intent/dependencies/FUNCIpv6IntentFunction.py
@@ -1816,8 +1816,8 @@
main.hostsData[ host ][ 'id' ] = hostj[ 'id' ]
main.hostsData[ host ][ 'vlan' ] = hostj[ 'vlan' ]
main.hostsData[ host ][ 'location' ] = \
- hostj[ 'location' ][ 'elementId' ] + '/' + \
- hostj[ 'location' ][ 'port' ]
+ hostj[ 'locations' ][ 0 ][ 'elementId' ] + '/' + \
+ hostj[ 'locations' ][ 0 ][ 'port' ]
main.hostsData[ host ][ 'ipAddresses' ] = hostj[ 'ipAddresses' ]
main.log.info( "Deactivating reactive forwarding app " )