Skip to content

Commit

Permalink
utils.network.hosts: Make subclass of Host instantiable
Browse files Browse the repository at this point in the history
A regression bug was introduced by 94fb7a8,which results Host's subclass
LocalHost can not be instantiated. Existing instantiation methods the same as
"localhost = LocalHost()" will no longer fail after changed.

Signed-off-by: Lei Yang <[email protected]>
  • Loading branch information
yanglei-rh committed Jul 7, 2023
1 parent 7c10487 commit 00a7258
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion avocado/utils/network/hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Host:
"""

def __init__(self, host):
if isinstance(self, Host):
if type(self) == Host: # pylint: disable=C0123
raise TypeError("Host class should not be instantiated")
self.host = host

Expand Down

0 comments on commit 00a7258

Please sign in to comment.