mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-18 18:39:21 +02:00
Run black linter
This commit is contained in:
parent
3a28a3a362
commit
542554959e
3 changed files with 14 additions and 8 deletions
|
@ -65,11 +65,16 @@ class EPPLibWrapper:
|
||||||
# Pool size
|
# Pool size
|
||||||
"size": settings.EPP_CONNECTION_POOL_SIZE,
|
"size": settings.EPP_CONNECTION_POOL_SIZE,
|
||||||
# Which errors the pool should look out for
|
# Which errors the pool should look out for
|
||||||
"exc_classes": (LoginError, RegistryError,),
|
"exc_classes": (
|
||||||
# Occasionally pings the registry to keep the connection alive
|
LoginError,
|
||||||
|
RegistryError,
|
||||||
|
),
|
||||||
|
# Occasionally pings the registry to keep the connection alive
|
||||||
"keepalive": settings.POOL_KEEP_ALIVE,
|
"keepalive": settings.POOL_KEEP_ALIVE,
|
||||||
}
|
}
|
||||||
self._pool = EppConnectionPool(client=self._client, login=self._login, options=options)
|
self._pool = EppConnectionPool(
|
||||||
|
client=self._client, login=self._login, options=options
|
||||||
|
)
|
||||||
|
|
||||||
def _send(self, command):
|
def _send(self, command):
|
||||||
"""Helper function used by `send`."""
|
"""Helper function used by `send`."""
|
||||||
|
|
|
@ -35,7 +35,7 @@ class Socket:
|
||||||
self.client.close()
|
self.client.close()
|
||||||
raise LoginError(response.msg)
|
raise LoginError(response.msg)
|
||||||
return self.client
|
return self.client
|
||||||
|
|
||||||
def disconnect(self):
|
def disconnect(self):
|
||||||
"""Close the connection."""
|
"""Close the connection."""
|
||||||
try:
|
try:
|
||||||
|
@ -43,7 +43,7 @@ class Socket:
|
||||||
self.client.close()
|
self.client.close()
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.warning("Connection to registry was not cleanly closed.")
|
logger.warning("Connection to registry was not cleanly closed.")
|
||||||
|
|
||||||
def send(self, command):
|
def send(self, command):
|
||||||
logger.debug(f"command is this: {command}")
|
logger.debug(f"command is this: {command}")
|
||||||
response = self.client.send(command)
|
response = self.client.send(command)
|
||||||
|
@ -53,4 +53,4 @@ class Socket:
|
||||||
self.client.close()
|
self.client.close()
|
||||||
raise LoginError(response.msg)
|
raise LoginError(response.msg)
|
||||||
"""
|
"""
|
||||||
return response
|
return response
|
||||||
|
|
|
@ -10,6 +10,7 @@ except ImportError:
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class EppConnectionPool(ConnectionPool):
|
class EppConnectionPool(ConnectionPool):
|
||||||
def __init__(self, client, login, options):
|
def __init__(self, client, login, options):
|
||||||
# For storing shared credentials
|
# For storing shared credentials
|
||||||
|
@ -35,8 +36,8 @@ class EppConnectionPool(ConnectionPool):
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
logger.error("Failed to keep the connection alive.", exc_info=True)
|
logger.error("Failed to keep the connection alive.", exc_info=True)
|
||||||
raise RegistryError("Failed to keep the connection alive.") from err
|
raise RegistryError("Failed to keep the connection alive.") from err
|
||||||
|
|
||||||
def create_socket(self, client, login) -> Socket:
|
def create_socket(self, client, login) -> Socket:
|
||||||
"""Creates and returns a socket instance"""
|
"""Creates and returns a socket instance"""
|
||||||
socket = Socket(client, login)
|
socket = Socket(client, login)
|
||||||
return socket
|
return socket
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue