MCPcopy
hub / github.com/retspen/webvirtcloud / _search_connection

Method _search_connection

vrtManager/connection.py:251–267  ·  view source on GitHub ↗

search the connection dict for a connection with the given credentials if it does not exist return None

(self, host, login, passwd, conn)

Source from the content-addressed store, hash-verified

249 self._event_loop.start()
250
251 def _search_connection(self, host, login, passwd, conn):
252 """
253 search the connection dict for a connection with the given credentials
254 if it does not exist return None
255 """
256 self._connections_lock.acquireRead()
257 try:
258 if (host in self._connections):
259 connections = self._connections[host]
260
261 for connection in connections:
262 if (connection.login == login and connection.passwd == passwd and connection.type == conn):
263 return connection
264 finally:
265 self._connections_lock.release()
266
267 return None
268
269 def get_connection(self, host, login, passwd, conn):
270 """

Callers 1

get_connectionMethod · 0.95

Calls 2

acquireReadMethod · 0.80
releaseMethod · 0.80

Tested by

no test coverage detected