mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-01 18:18:34 +02:00
Add PR suggestions
This commit is contained in:
parent
a87519e615
commit
91c68f91f1
7 changed files with 37 additions and 17 deletions
|
@ -48,7 +48,7 @@ class Socket:
|
|||
|
||||
def send(self, command):
|
||||
"""Sends a command to the registry.
|
||||
If the response code is >= 2000,
|
||||
If the RegistryError code is >= 2000,
|
||||
then this function raises a LoginError.
|
||||
The calling function should handle this."""
|
||||
response = self.client.send(command)
|
||||
|
@ -59,7 +59,9 @@ class Socket:
|
|||
return response
|
||||
|
||||
def is_login_error(self, code):
|
||||
"""Returns the result of code >= 2000"""
|
||||
"""Returns the result of code >= 2000 for RegistryError.
|
||||
This indicates that something weird happened on the Registry,
|
||||
and that we should return a LoginError."""
|
||||
return code >= 2000
|
||||
|
||||
def test_connection_success(self):
|
||||
|
@ -90,7 +92,7 @@ class Socket:
|
|||
|
||||
# If we encounter a login error, fail
|
||||
if self.is_login_error(response.code):
|
||||
logger.warning("was login error")
|
||||
logger.warning("A login error was found in test_connection_success")
|
||||
return False
|
||||
|
||||
# Otherwise, just return true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue