diff --git a/src/primaite/game/agent/actions.py b/src/primaite/game/agent/actions.py index c70d4d66..8eed3ba4 100644 --- a/src/primaite/game/agent/actions.py +++ b/src/primaite/game/agent/actions.py @@ -424,7 +424,7 @@ class NetworkACLAddRuleAction(AbstractAction): elif permission == 2: permission_str = "DENY" else: - _LOGGER.warn(f"{self.__class__} received permission {permission}, expected 0 or 1.") + _LOGGER.warning(f"{self.__class__} received permission {permission}, expected 0 or 1.") if protocol_id == 0: return ["do_nothing"] # NOT SUPPORTED, JUST DO NOTHING IF WE COME ACROSS THIS diff --git a/src/primaite/game/agent/observations.py b/src/primaite/game/agent/observations.py index 93fd81b8..767514b4 100644 --- a/src/primaite/game/agent/observations.py +++ b/src/primaite/game/agent/observations.py @@ -264,7 +264,7 @@ class FolderObservation(AbstractObservation): while len(self.files) > num_files_per_folder: truncated_file = self.files.pop() msg = f"Too many files in folder observation. Truncating file {truncated_file}" - _LOGGER.warn(msg) + _LOGGER.warning(msg) self.default_observation = { "health_status": 0, @@ -438,7 +438,7 @@ class NodeObservation(AbstractObservation): while len(self.services) > num_services_per_node: truncated_service = self.services.pop() msg = f"Too many services in Node observation space for node. Truncating service {truncated_service.where}" - _LOGGER.warn(msg) + _LOGGER.warning(msg) # truncate service list self.folders: List[FolderObservation] = folders @@ -448,7 +448,7 @@ class NodeObservation(AbstractObservation): while len(self.folders) > num_folders_per_node: truncated_folder = self.folders.pop() msg = f"Too many folders in Node observation for node. Truncating service {truncated_folder.where[-1]}" - _LOGGER.warn(msg) + _LOGGER.warning(msg) self.nics: List[NicObservation] = nics while len(self.nics) < num_nics_per_node: @@ -456,7 +456,7 @@ class NodeObservation(AbstractObservation): while len(self.nics) > num_nics_per_node: truncated_nic = self.nics.pop() msg = f"Too many NICs in Node observation for node. Truncating service {truncated_nic.where[-1]}" - _LOGGER.warn(msg) + _LOGGER.warning(msg) self.logon_status: bool = logon_status diff --git a/src/primaite/game/agent/rewards.py b/src/primaite/game/agent/rewards.py index 3466114c..ca6d8a12 100644 --- a/src/primaite/game/agent/rewards.py +++ b/src/primaite/game/agent/rewards.py @@ -210,7 +210,7 @@ class WebServer404Penalty(AbstractReward): f"{cls.__name__} could not be initialised from config because node_ref and service_ref were not " "found in reward config." ) - _LOGGER.warn(msg) + _LOGGER.warning(msg) return DummyReward() # TODO: should we error out with incorrect inputs? Probably! node_uuid = game.ref_map_nodes[node_ref] service_uuid = game.ref_map_services[service_ref] @@ -219,7 +219,7 @@ class WebServer404Penalty(AbstractReward): f"{cls.__name__} could not be initialised because node {node_ref} and service {service_ref} were not" " found in the simulator." ) - _LOGGER.warn(msg) + _LOGGER.warning(msg) return DummyReward() # TODO: consider erroring here as well return cls(node_uuid=node_uuid, service_uuid=service_uuid) diff --git a/src/primaite/simulator/core.py b/src/primaite/simulator/core.py index 18a470cd..5e1953e2 100644 --- a/src/primaite/simulator/core.py +++ b/src/primaite/simulator/core.py @@ -113,7 +113,7 @@ class RequestManager(BaseModel): """ if name in self.request_types: msg = f"Overwriting request type {name}." - _LOGGER.warn(msg) + _LOGGER.warning(msg) self.request_types[name] = request_type @@ -252,6 +252,6 @@ class SimComponent(BaseModel): def parent(self, new_parent: Union["SimComponent", None]) -> None: if self._parent and new_parent: msg = f"Overwriting parent of {self.uuid}. Old parent: {self._parent.uuid}, New parent: {new_parent.uuid}" - _LOGGER.warn(msg) + _LOGGER.warning(msg) raise RuntimeWarning(msg) self._parent = new_parent