X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=RO-SDN-onos_openflow%2Fosm_rosdn_onosof%2Fonos_of.py;h=be8fa7d5902e4ce54f09716dcd4495ddedf90023;hb=aca8cb5e63ebd11cc69373323d8df62b5d8cbfe2;hp=cba505cb9855cbcc77dd61ea63dacf95bbe4ddbe;hpb=80135b928ab442c38898750b4751480205b4affc;p=osm%2FRO.git diff --git a/RO-SDN-onos_openflow/osm_rosdn_onosof/onos_of.py b/RO-SDN-onos_openflow/osm_rosdn_onosof/onos_of.py index cba505cb..be8fa7d5 100644 --- a/RO-SDN-onos_openflow/osm_rosdn_onosof/onos_of.py +++ b/RO-SDN-onos_openflow/osm_rosdn_onosof/onos_of.py @@ -28,15 +28,16 @@ controller. It creates the class OF_conn to create dataplane connections with static rules based on packet destination MAC address """ -import json -import requests import base64 +import json import logging + from osm_ro_plugin.openflow_conn import ( OpenflowConn, OpenflowConnConnectionException, OpenflowConnUnexpectedResponse, ) +import requests # OpenflowConnException, OpenflowConnAuthException, OpenflowConnNotFoundException, \ # OpenflowConnConflictException, OpenflowConnNotSupportedException, OpenflowConnNotImplemented @@ -127,7 +128,7 @@ class OfConnOnos(OpenflowConn): self.logger.debug("get_of_switches " + error_text) info = of_response.json() - if type(info) != dict: + if not info.isinstance(dict): self.logger.error( "get_of_switches. Unexpected response, not a dict: %s", str(info) ) @@ -311,7 +312,7 @@ class OfConnOnos(OpenflowConn): info = of_response.json() - if type(info) != dict: + if not info.isinstance(dict): self.logger.error( "get_of_rules. Unexpected response, not a dict: %s", str(info),