diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 7a013a4..7fe34d2 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,3 +1,4 @@ + # This workflow will install dependencies, create coverage tests and run Pytest Coverage Comment # For more information see: https://github.com/MishaKav/pytest-coverage-comment/ name: pytest-coverage-comment @@ -31,3 +32,4 @@ jobs: with: pytest-coverage-path: ./pytest-coverage.txt junitxml-path: ./pytest.xml + diff --git a/simple_vm_client/VirtualMachineHandler.py b/simple_vm_client/VirtualMachineHandler.py index 1e348a9..76f0189 100644 --- a/simple_vm_client/VirtualMachineHandler.py +++ b/simple_vm_client/VirtualMachineHandler.py @@ -141,13 +141,13 @@ def get_server(self, openstack_id: str) -> VM: return server def get_servers(self) -> list[VM]: - servers = openstack_servers = self.openstack_connector.get_servers() + servers = self.openstack_connector.get_servers() servers_full = [] for server in servers: servers_full.append(self.forc_connector.get_playbook_status(server=server)) serv = thrift_converter.os_to_thrift_servers(openstack_servers=servers) - return servers_full + return serv def get_servers_by_ids(self, server_ids: list[str]) -> list[VM]: return thrift_converter.os_to_thrift_servers( diff --git a/simple_vm_client/util/thrift_converter.py b/simple_vm_client/util/thrift_converter.py index 8af1177..0cfd560 100644 --- a/simple_vm_client/util/thrift_converter.py +++ b/simple_vm_client/util/thrift_converter.py @@ -67,8 +67,8 @@ def os_to_thrift_volume(openstack_volume: OpenStack_Volume) -> Volume: try: device = openstack_volume.attachments[0]["device"] server_id = openstack_volume.attachments[0]["server_id"] - except Exception: - pass + except Exception as e: + logger.log(f"Exception on os_to_thrift_volume:\n{e}") volume = Volume( status=openstack_volume.status, id=openstack_volume.id,