diff --git a/src/cloud_what/providers/aws.py b/src/cloud_what/providers/aws.py index dc1fca1827..343134bede 100644 --- a/src/cloud_what/providers/aws.py +++ b/src/cloud_what/providers/aws.py @@ -120,7 +120,7 @@ def is_likely_running_on_cloud(self) -> float: found_amazon_ec2 = False found_aws = False for hw_item in self.hw_info.values(): - if type(hw_item) != str: + if type(hw_item) is str: continue if "amazon ec2" in hw_item.lower(): found_amazon_ec2 = True diff --git a/src/cloud_what/providers/azure.py b/src/cloud_what/providers/azure.py index 3e9de2c0d9..8e42e36f7d 100644 --- a/src/cloud_what/providers/azure.py +++ b/src/cloud_what/providers/azure.py @@ -126,7 +126,7 @@ def is_likely_running_on_cloud(self): found_microsoft = False found_azure = False for hw_item in self.hw_info.values(): - if type(hw_item) != str: + if type(hw_item) is str: continue if "microsoft" in hw_item.lower(): found_microsoft = True diff --git a/src/cloud_what/providers/gcp.py b/src/cloud_what/providers/gcp.py index d472709fc4..eaad940f3b 100644 --- a/src/cloud_what/providers/gcp.py +++ b/src/cloud_what/providers/gcp.py @@ -138,7 +138,7 @@ def is_likely_running_on_cloud(self): found_google = False found_gcp = False for hw_item in self.hw_info.values(): - if type(hw_item) != str: + if type(hw_item) is str: continue if "google" in hw_item.lower(): found_google = True diff --git a/src/rhsmlib/client_info.py b/src/rhsmlib/client_info.py index a7132266d3..aed83ffbd5 100644 --- a/src/rhsmlib/client_info.py +++ b/src/rhsmlib/client_info.py @@ -58,7 +58,7 @@ def get_cmd_line(sender, bus=None): if bus is None: bus = dbus.SystemBus() cmd_line = dbus_utils.command_of_sender(bus, sender) - if cmd_line is not None and type(cmd_line) == str: + if cmd_line is not None and type(cmd_line) is str: # Store only first argument of command line (no argument including username or password) cmd_line = cmd_line.split()[0] return cmd_line diff --git a/src/subscription_manager/productid.py b/src/subscription_manager/productid.py index db2aa31608..be19accc56 100644 --- a/src/subscription_manager/productid.py +++ b/src/subscription_manager/productid.py @@ -751,7 +751,7 @@ def _get_cert(self, filename): f = open(filename) try: pem = f.read() - if type(pem) == bytes: + if type(pem) is bytes: pem = pem.decode("utf-8") cert = create_from_pem(pem) cert.pem = pem diff --git a/src/syspurpose/files.py b/src/syspurpose/files.py index c25ef93f26..6c7cd72e12 100644 --- a/src/syspurpose/files.py +++ b/src/syspurpose/files.py @@ -784,7 +784,7 @@ def detect_changed(base: dict, other: dict, key: str, source: str = "server") -> return bool(base_val) # Handle "addons" (the lists might be out of order from the server) - if type(base_val) == list and type(other_val) == list: + if type(base_val) is list and type(other_val) is list: return sorted(base_val) != sorted(other_val) # When value is removed from server, then it is set to empty string, but