#2084: change all instances of retrieving software from software['software_name'] to software.get() + adding some tests for describe state

This commit is contained in:
Czar Echavez
2023-11-30 13:49:37 +00:00
parent 7c1ffb5ba1
commit 3cf21e4015
30 changed files with 394 additions and 97 deletions

View File

@@ -107,7 +107,7 @@ class DatabaseClient(Application):
def disconnect(self):
"""Disconnect from the Database Service."""
if self.connected and self.operating_state.RUNNING:
if self.connected and self.operating_state is ApplicationOperatingState.RUNNING:
software_manager: SoftwareManager = self.software_manager
software_manager.send_payload_to_session_manager(
payload={"type": "disconnect"}, dest_ip_address=self.server_ip_address, dest_port=self.port
@@ -186,6 +186,9 @@ class DatabaseClient(Application):
:param session_id: The session id the payload relates to.
:return: True.
"""
if not self._can_perform_action():
return False
if isinstance(payload, dict) and payload.get("type"):
if payload["type"] == "connect_response":
self.connected = payload["response"] == True