X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FRO.git;a=blobdiff_plain;f=RO-SDN-floodlight_openflow%2Fosm_rosdn_floodlightof%2Ffloodlight_of.py;fp=RO-SDN-floodlight_openflow%2Fosm_rosdn_floodlightof%2Ffloodlight_of.py;h=43b3a302bdee68fbd904c70b02c0e6d6955f9571;hp=c5fec1a1ac87eea1478f47b173491a714d4a6794;hb=aca8cb5e63ebd11cc69373323d8df62b5d8cbfe2;hpb=df48655ed39c3b5202289bcc84cd1618ce5464af diff --git a/RO-SDN-floodlight_openflow/osm_rosdn_floodlightof/floodlight_of.py b/RO-SDN-floodlight_openflow/osm_rosdn_floodlightof/floodlight_of.py index c5fec1a1..43b3a302 100644 --- a/RO-SDN-floodlight_openflow/osm_rosdn_floodlightof/floodlight_of.py +++ b/RO-SDN-floodlight_openflow/osm_rosdn_floodlightof/floodlight_of.py @@ -241,7 +241,7 @@ class OfConnFloodLight(OpenflowConn): self.logger.debug("get_of_rules " + error_text) 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(type(info)) ) @@ -445,7 +445,7 @@ class OfConnFloodLight(OpenflowConn): self.logger.debug("obtain_port_correspondence " + error_text) info = of_response.json() - if type(info) != dict: + if not info.isinstance(dict): raise OpenflowConnUnexpectedResponse( "unexpected openflow port-desc response, " "not a dict. Wrong version?" @@ -457,10 +457,9 @@ class OfConnFloodLight(OpenflowConn): "'portDesc' not found. Wrong version?" ) - if ( - type(info["portDesc"]) != list - and type(info["portDesc"]) != tuple - ): + if not info["portDesc"].isinstance(list) and not info[ + "portDesc" + ].isinstance(tuple): raise OpenflowConnUnexpectedResponse( "unexpected openflow port-desc response at " "'portDesc', not a list. Wrong version?"