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))
)
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?"
"'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?"
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)
)
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),
].spec.ip.ipAddress
for device in vm_obj.config.hardware.device:
- if type(device) == vim.vm.device.VirtualPCIPassthrough:
+ if device.isinstance(vim.vm.device.VirtualPCIPassthrough):
device_details = {
"devide_id": device.backing.id,
"pciSlotNumber": device.slotInfo.pciSlotNumber,
--- /dev/null
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+---
+other:
+ - |
+ This change pins flake8 version in tox.ini to 6.1.0. In addition, all the flake8
+ issues have been properly fixed. All fixes are related to comparisons done with
+ == or != instead of using the keyword isinstance.
+
#######################################################################################
[testenv:flake8]
-deps = flake8
+deps =
+ flake8==6.1.0
flake8-import-order
skip_install = true
commands =