Fixing restconf_client.py script 16/89516/1
authorottero <rodrigo.ottero@est.tech>
Thu, 6 Jun 2019 13:46:11 +0000 (13:46 +0000)
committerottero <rodrigo.ottero@est.tech>
Thu, 6 Jun 2019 13:46:11 +0000 (13:46 +0000)
The restconf_client.py script uses BlueprintWebClientService to send
REST requests to ODL. When the methods of that interface have the type
of the returns changed from String to WebClientResponse, the script
stopped working.

This fix changes the way the response is manipulated, to act upon a
WebClientResponse and not on a String

Change-Id: I3876c5b27d65058f0b5b77da17f9225fc04779c6
Issue-ID: CCSDK-1384
Signed-off-by: ottero <rodrigo.ottero@est.tech>
components/scripts/python/ccsdk_restconf/restconf_client.py

index 92069c5..6d18b03 100644 (file)
@@ -47,7 +47,7 @@ class RestconfClient:
         expected_result = '"netconf-node-topology:connection-status":"connected"'
         while counter < self.__odl_status_check_limit:
             result = web_client_service.exchangeResource("GET", url, "")
-            if expected_result in result:
+            if expected_result in result.body:
                 self.__log.info("NF was mounted successfully on ODL")
                 return None
             sleep(self.__odl_status_check_pause)