def __init__(self, host, conn):
"""
Sets all class attributes and tries to open the connection
"""
# connection lock is used to lock all changes to the connection state attributes
# (connection and last_error)
self.connection_state_lock = threading.Lock()
self.connection = None
self.last_error = None
# credentials
self.host = host
self.login = kvm_config.get('user')
self.passwd = kvm_config.get('password')
self.type = conn
# connect
self.connect()
评论列表
文章目录